GDB (xrefs)
/tmp/gdb-7.10/gdb/memattr.c
Go to the documentation of this file.
1 /* Memory attributes support, for GDB.
2 
3  Copyright (C) 2001-2015 Free Software Foundation, Inc.
4 
5  This file is part of GDB.
6 
7  This program is free software; you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation; either version 3 of the License, or
10  (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program. If not, see <http://www.gnu.org/licenses/>. */
19 
20 #include "defs.h"
21 #include "command.h"
22 #include "gdbcmd.h"
23 #include "memattr.h"
24 #include "target.h"
25 #include "target-dcache.h"
26 #include "value.h"
27 #include "language.h"
28 #include "vec.h"
29 #include "breakpoint.h"
30 #include "cli/cli-utils.h"
31 
32 const struct mem_attrib default_mem_attrib =
33 {
34  MEM_RW, /* mode */
36  0, /* hwbreak */
37  0, /* cache */
38  0, /* verify */
39  -1 /* Flash blocksize not specified. */
40 };
41 
42 const struct mem_attrib unknown_mem_attrib =
43 {
44  MEM_NONE, /* mode */
46  0, /* hwbreak */
47  0, /* cache */
48  0, /* verify */
49  -1 /* Flash blocksize not specified. */
50 };
51 
52 
53 VEC(mem_region_s) *mem_region_list, *target_mem_region_list;
54 static int mem_number = 0;
55 
56 /* If this flag is set, the memory region list should be automatically
57  updated from the target. If it is clear, the list is user-controlled
58  and should be left alone. */
59 static int mem_use_target = 1;
60 
61 /* If this flag is set, we have tried to fetch the target memory regions
62  since the last time it was invalidated. If that list is still
63  empty, then the target can't supply memory regions. */
64 static int target_mem_regions_valid;
65 
66 /* If this flag is set, gdb will assume that memory ranges not
67  specified by the memory map have type MEM_NONE, and will
68  emit errors on all accesses to that memory. */
69 static int inaccessible_by_default = 1;
70 
71 static void
72 show_inaccessible_by_default (struct ui_file *file, int from_tty,
73  struct cmd_list_element *c,
74  const char *value)
75 {
76  if (inaccessible_by_default)
77  fprintf_filtered (file, _("Unknown memory addresses will "
78  "be treated as inaccessible.\n"));
79  else
80  fprintf_filtered (file, _("Unknown memory addresses "
81  "will be treated as RAM.\n"));
82 }
83 
84 
85 /* Predicate function which returns true if LHS should sort before RHS
86  in a list of memory regions, useful for VEC_lower_bound. */
87 
88 static int
89 mem_region_lessthan (const struct mem_region *lhs,
90  const struct mem_region *rhs)
91 {
92  return lhs->lo < rhs->lo;
93 }
94 
95 /* A helper function suitable for qsort, used to sort a
96  VEC(mem_region_s) by starting address. */
97 
98 int
99 mem_region_cmp (const void *untyped_lhs, const void *untyped_rhs)
100 {
101  const struct mem_region *lhs = untyped_lhs;
102  const struct mem_region *rhs = untyped_rhs;
103 
104  if (lhs->lo < rhs->lo)
105  return -1;
106  else if (lhs->lo == rhs->lo)
107  return 0;
108  else
109  return 1;
110 }
111 
112 /* Allocate a new memory region, with default settings. */
113 
114 void
115 mem_region_init (struct mem_region *newobj)
116 {
117  memset (newobj, 0, sizeof (struct mem_region));
118  newobj->enabled_p = 1;
119  newobj->attrib = default_mem_attrib;
120 }
121 
122 /* This function should be called before any command which would
123  modify the memory region list. It will handle switching from
124  a target-provided list to a local list, if necessary. */
125 
126 static void
127 require_user_regions (int from_tty)
128 {
129  struct mem_region *m;
130  int ix, length;
131 
132  /* If we're already using a user-provided list, nothing to do. */
133  if (!mem_use_target)
134  return;
135 
136  /* Switch to a user-provided list (possibly a copy of the current
137  one). */
138  mem_use_target = 0;
139 
140  /* If we don't have a target-provided region list yet, then
141  no need to warn. */
142  if (mem_region_list == NULL)
143  return;
144 
145  /* Otherwise, let the user know how to get back. */
146  if (from_tty)
147  warning (_("Switching to manual control of memory regions; use "
148  "\"mem auto\" to fetch regions from the target again."));
149 
150  /* And create a new list for the user to modify. */
151  length = VEC_length (mem_region_s, target_mem_region_list);
152  mem_region_list = VEC_alloc (mem_region_s, length);
153  for (ix = 0; VEC_iterate (mem_region_s, target_mem_region_list, ix, m); ix++)
154  VEC_quick_push (mem_region_s, mem_region_list, m);
155 }
156 
157 /* This function should be called before any command which would
158  read the memory region list, other than those which call
159  require_user_regions. It will handle fetching the
160  target-provided list, if necessary. */
161 
162 static void
164 {
165  if (mem_use_target && !target_mem_regions_valid)
166  {
167  target_mem_regions_valid = 1;
168  target_mem_region_list = target_memory_map ();
169  mem_region_list = target_mem_region_list;
170  }
171 }
172 
173 static void
175  const struct mem_attrib *attrib)
176 {
177  struct mem_region newobj;
178  int i, ix;
179 
180  /* lo == hi is a useless empty region. */
181  if (lo >= hi && hi != 0)
182  {
183  printf_unfiltered (_("invalid memory region: low >= high\n"));
184  return;
185  }
186 
187  mem_region_init (&newobj);
188  newobj.lo = lo;
189  newobj.hi = hi;
190 
191  ix = VEC_lower_bound (mem_region_s, mem_region_list, &newobj,
193 
194  /* Check for an overlapping memory region. We only need to check
195  in the vicinity - at most one before and one after the
196  insertion point. */
197  for (i = ix - 1; i < ix + 1; i++)
198  {
199  struct mem_region *n;
200 
201  if (i < 0)
202  continue;
203  if (i >= VEC_length (mem_region_s, mem_region_list))
204  continue;
205 
206  n = VEC_index (mem_region_s, mem_region_list, i);
207 
208  if ((lo >= n->lo && (lo < n->hi || n->hi == 0))
209  || (hi > n->lo && (hi <= n->hi || n->hi == 0))
210  || (lo <= n->lo && ((hi >= n->hi && n->hi != 0) || hi == 0)))
211  {
212  printf_unfiltered (_("overlapping memory region\n"));
213  return;
214  }
215  }
216 
217  newobj.number = ++mem_number;
218  newobj.attrib = *attrib;
219  VEC_safe_insert (mem_region_s, mem_region_list, ix, &newobj);
220 }
221 
222 /*
223  * Look up the memory region cooresponding to ADDR.
224  */
225 struct mem_region *
227 {
228  static struct mem_region region;
229  struct mem_region *m;
230  CORE_ADDR lo;
231  CORE_ADDR hi;
232  int ix;
233 
235 
236  /* First we initialize LO and HI so that they describe the entire
237  memory space. As we process the memory region chain, they are
238  redefined to describe the minimal region containing ADDR. LO
239  and HI are used in the case where no memory region is defined
240  that contains ADDR. If a memory region is disabled, it is
241  treated as if it does not exist. The initial values for LO
242  and HI represent the bottom and top of memory. */
243 
244  lo = 0;
245  hi = 0;
246 
247  /* Either find memory range containing ADDRESS, or set LO and HI
248  to the nearest boundaries of an existing memory range.
249 
250  If we ever want to support a huge list of memory regions, this
251  check should be replaced with a binary search (probably using
252  VEC_lower_bound). */
253  for (ix = 0; VEC_iterate (mem_region_s, mem_region_list, ix, m); ix++)
254  {
255  if (m->enabled_p == 1)
256  {
257  /* If the address is in the memory region, return that
258  memory range. */
259  if (addr >= m->lo && (addr < m->hi || m->hi == 0))
260  return m;
261 
262  /* This (correctly) won't match if m->hi == 0, representing
263  the top of the address space, because CORE_ADDR is unsigned;
264  no value of LO is less than zero. */
265  if (addr >= m->hi && lo < m->hi)
266  lo = m->hi;
267 
268  /* This will never set HI to zero; if we're here and ADDR
269  is at or below M, and the region starts at zero, then ADDR
270  would have been in the region. */
271  if (addr <= m->lo && (hi == 0 || hi > m->lo))
272  hi = m->lo;
273  }
274  }
275 
276  /* Because no region was found, we must cons up one based on what
277  was learned above. */
278  region.lo = lo;
279  region.hi = hi;
280 
281  /* When no memory map is defined at all, we always return
282  'default_mem_attrib', so that we do not make all memory
283  inaccessible for targets that don't provide a memory map. */
284  if (inaccessible_by_default && !VEC_empty (mem_region_s, mem_region_list))
285  region.attrib = unknown_mem_attrib;
286  else
287  region.attrib = default_mem_attrib;
288 
289  return &region;
290 }
291 
292 /* Invalidate any memory regions fetched from the target. */
293 
294 void
296 {
297  if (!target_mem_regions_valid)
298  return;
299 
300  target_mem_regions_valid = 0;
301  VEC_free (mem_region_s, target_mem_region_list);
302  if (mem_use_target)
303  mem_region_list = NULL;
304 }
305 
306 /* Clear memory region list. */
307 
308 static void
309 mem_clear (void)
310 {
311  VEC_free (mem_region_s, mem_region_list);
312 }
313 
314 
315 static void
316 mem_command (char *args, int from_tty)
317 {
318  CORE_ADDR lo, hi;
319  char *tok;
320  struct mem_attrib attrib;
321 
322  if (!args)
323  error_no_arg (_("No mem"));
324 
325  /* For "mem auto", switch back to using a target provided list. */
326  if (strcmp (args, "auto") == 0)
327  {
328  if (mem_use_target)
329  return;
330 
331  if (mem_region_list != target_mem_region_list)
332  {
333  mem_clear ();
334  mem_region_list = target_mem_region_list;
335  }
336 
337  mem_use_target = 1;
338  return;
339  }
340 
341  require_user_regions (from_tty);
342 
343  tok = strtok (args, " \t");
344  if (!tok)
345  error (_("no lo address"));
346  lo = parse_and_eval_address (tok);
347 
348  tok = strtok (NULL, " \t");
349  if (!tok)
350  error (_("no hi address"));
351  hi = parse_and_eval_address (tok);
352 
353  attrib = default_mem_attrib;
354  while ((tok = strtok (NULL, " \t")) != NULL)
355  {
356  if (strcmp (tok, "rw") == 0)
357  attrib.mode = MEM_RW;
358  else if (strcmp (tok, "ro") == 0)
359  attrib.mode = MEM_RO;
360  else if (strcmp (tok, "wo") == 0)
361  attrib.mode = MEM_WO;
362 
363  else if (strcmp (tok, "8") == 0)
364  attrib.width = MEM_WIDTH_8;
365  else if (strcmp (tok, "16") == 0)
366  {
367  if ((lo % 2 != 0) || (hi % 2 != 0))
368  error (_("region bounds not 16 bit aligned"));
369  attrib.width = MEM_WIDTH_16;
370  }
371  else if (strcmp (tok, "32") == 0)
372  {
373  if ((lo % 4 != 0) || (hi % 4 != 0))
374  error (_("region bounds not 32 bit aligned"));
375  attrib.width = MEM_WIDTH_32;
376  }
377  else if (strcmp (tok, "64") == 0)
378  {
379  if ((lo % 8 != 0) || (hi % 8 != 0))
380  error (_("region bounds not 64 bit aligned"));
381  attrib.width = MEM_WIDTH_64;
382  }
383 
384 #if 0
385  else if (strcmp (tok, "hwbreak") == 0)
386  attrib.hwbreak = 1;
387  else if (strcmp (tok, "swbreak") == 0)
388  attrib.hwbreak = 0;
389 #endif
390 
391  else if (strcmp (tok, "cache") == 0)
392  attrib.cache = 1;
393  else if (strcmp (tok, "nocache") == 0)
394  attrib.cache = 0;
395 
396 #if 0
397  else if (strcmp (tok, "verify") == 0)
398  attrib.verify = 1;
399  else if (strcmp (tok, "noverify") == 0)
400  attrib.verify = 0;
401 #endif
402 
403  else
404  error (_("unknown attribute: %s"), tok);
405  }
406 
407  create_mem_region (lo, hi, &attrib);
408 }
409 
410 
411 static void
412 mem_info_command (char *args, int from_tty)
413 {
414  struct mem_region *m;
415  struct mem_attrib *attrib;
416  int ix;
417 
418  if (mem_use_target)
419  printf_filtered (_("Using memory regions provided by the target.\n"));
420  else
421  printf_filtered (_("Using user-defined memory regions.\n"));
422 
424 
425  if (!mem_region_list)
426  {
427  printf_unfiltered (_("There are no memory regions defined.\n"));
428  return;
429  }
430 
431  printf_filtered ("Num ");
432  printf_filtered ("Enb ");
433  printf_filtered ("Low Addr ");
434  if (gdbarch_addr_bit (target_gdbarch ()) > 32)
435  printf_filtered (" ");
436  printf_filtered ("High Addr ");
437  if (gdbarch_addr_bit (target_gdbarch ()) > 32)
438  printf_filtered (" ");
439  printf_filtered ("Attrs ");
440  printf_filtered ("\n");
441 
442  for (ix = 0; VEC_iterate (mem_region_s, mem_region_list, ix, m); ix++)
443  {
444  char *tmp;
445 
446  printf_filtered ("%-3d %-3c\t",
447  m->number,
448  m->enabled_p ? 'y' : 'n');
449  if (gdbarch_addr_bit (target_gdbarch ()) <= 32)
450  tmp = hex_string_custom (m->lo, 8);
451  else
452  tmp = hex_string_custom (m->lo, 16);
453 
454  printf_filtered ("%s ", tmp);
455 
456  if (gdbarch_addr_bit (target_gdbarch ()) <= 32)
457  {
458  if (m->hi == 0)
459  tmp = "0x100000000";
460  else
461  tmp = hex_string_custom (m->hi, 8);
462  }
463  else
464  {
465  if (m->hi == 0)
466  tmp = "0x10000000000000000";
467  else
468  tmp = hex_string_custom (m->hi, 16);
469  }
470 
471  printf_filtered ("%s ", tmp);
472 
473  /* Print a token for each attribute.
474 
475  * FIXME: Should we output a comma after each token? It may
476  * make it easier for users to read, but we'd lose the ability
477  * to cut-and-paste the list of attributes when defining a new
478  * region. Perhaps that is not important.
479  *
480  * FIXME: If more attributes are added to GDB, the output may
481  * become cluttered and difficult for users to read. At that
482  * time, we may want to consider printing tokens only if they
483  * are different from the default attribute. */
484 
485  attrib = &m->attrib;
486  switch (attrib->mode)
487  {
488  case MEM_RW:
489  printf_filtered ("rw ");
490  break;
491  case MEM_RO:
492  printf_filtered ("ro ");
493  break;
494  case MEM_WO:
495  printf_filtered ("wo ");
496  break;
497  case MEM_FLASH:
498  printf_filtered ("flash blocksize 0x%x ", attrib->blocksize);
499  break;
500  }
501 
502  switch (attrib->width)
503  {
504  case MEM_WIDTH_8:
505  printf_filtered ("8 ");
506  break;
507  case MEM_WIDTH_16:
508  printf_filtered ("16 ");
509  break;
510  case MEM_WIDTH_32:
511  printf_filtered ("32 ");
512  break;
513  case MEM_WIDTH_64:
514  printf_filtered ("64 ");
515  break;
517  break;
518  }
519 
520 #if 0
521  if (attrib->hwbreak)
522  printf_filtered ("hwbreak");
523  else
524  printf_filtered ("swbreak");
525 #endif
526 
527  if (attrib->cache)
528  printf_filtered ("cache ");
529  else
530  printf_filtered ("nocache ");
531 
532 #if 0
533  if (attrib->verify)
534  printf_filtered ("verify ");
535  else
536  printf_filtered ("noverify ");
537 #endif
538 
539  printf_filtered ("\n");
540 
542  }
543 }
544 
545 
546 /* Enable the memory region number NUM. */
547 
548 static void
549 mem_enable (int num)
550 {
551  struct mem_region *m;
552  int ix;
553 
554  for (ix = 0; VEC_iterate (mem_region_s, mem_region_list, ix, m); ix++)
555  if (m->number == num)
556  {
557  m->enabled_p = 1;
558  return;
559  }
560  printf_unfiltered (_("No memory region number %d.\n"), num);
561 }
562 
563 static void
564 mem_enable_command (char *args, int from_tty)
565 {
566  int num;
567  struct mem_region *m;
568  int ix;
569 
570  require_user_regions (from_tty);
571 
573 
574  if (args == NULL || *args == '\0')
575  { /* Enable all mem regions. */
576  for (ix = 0; VEC_iterate (mem_region_s, mem_region_list, ix, m); ix++)
577  m->enabled_p = 1;
578  }
579  else
580  {
581  struct get_number_or_range_state state;
582 
583  init_number_or_range (&state, args);
584  while (!state.finished)
585  {
586  num = get_number_or_range (&state);
587  mem_enable (num);
588  }
589  }
590 }
591 
592 
593 /* Disable the memory region number NUM. */
594 
595 static void
596 mem_disable (int num)
597 {
598  struct mem_region *m;
599  int ix;
600 
601  for (ix = 0; VEC_iterate (mem_region_s, mem_region_list, ix, m); ix++)
602  if (m->number == num)
603  {
604  m->enabled_p = 0;
605  return;
606  }
607  printf_unfiltered (_("No memory region number %d.\n"), num);
608 }
609 
610 static void
611 mem_disable_command (char *args, int from_tty)
612 {
613  int num;
614  struct mem_region *m;
615  int ix;
616 
617  require_user_regions (from_tty);
618 
620 
621  if (args == NULL || *args == '\0')
622  {
623  for (ix = 0; VEC_iterate (mem_region_s, mem_region_list, ix, m); ix++)
624  m->enabled_p = 0;
625  }
626  else
627  {
628  struct get_number_or_range_state state;
629 
630  init_number_or_range (&state, args);
631  while (!state.finished)
632  {
633  num = get_number_or_range (&state);
634  mem_disable (num);
635  }
636  }
637 }
638 
639 /* Delete the memory region number NUM. */
640 
641 static void
642 mem_delete (int num)
643 {
644  struct mem_region *m;
645  int ix;
646 
647  if (!mem_region_list)
648  {
649  printf_unfiltered (_("No memory region number %d.\n"), num);
650  return;
651  }
652 
653  for (ix = 0; VEC_iterate (mem_region_s, mem_region_list, ix, m); ix++)
654  if (m->number == num)
655  break;
656 
657  if (m == NULL)
658  {
659  printf_unfiltered (_("No memory region number %d.\n"), num);
660  return;
661  }
662 
663  VEC_ordered_remove (mem_region_s, mem_region_list, ix);
664 }
665 
666 static void
667 mem_delete_command (char *args, int from_tty)
668 {
669  int num;
670  struct get_number_or_range_state state;
671 
672  require_user_regions (from_tty);
673 
675 
676  if (args == NULL || *args == '\0')
677  {
678  if (query (_("Delete all memory regions? ")))
679  mem_clear ();
680  dont_repeat ();
681  return;
682  }
683 
684  init_number_or_range (&state, args);
685  while (!state.finished)
686  {
687  num = get_number_or_range (&state);
688  mem_delete (num);
689  }
690 
691  dont_repeat ();
692 }
693 
694 static void
695 dummy_cmd (char *args, int from_tty)
696 {
697 }
698 
699 extern initialize_file_ftype _initialize_mem; /* -Wmissing-prototype */
700 
703 
704 void
706 {
707  add_com ("mem", class_vars, mem_command, _("\
708 Define attributes for memory region or reset memory region handling to\n\
709 target-based.\n\
710 Usage: mem auto\n\
711  mem <lo addr> <hi addr> [<mode> <width> <cache>],\n\
712 where <mode> may be rw (read/write), ro (read-only) or wo (write-only),\n\
713  <width> may be 8, 16, 32, or 64, and\n\
714  <cache> may be cache or nocache"));
715 
717 Enable memory region.\n\
718 Arguments are the code numbers of the memory regions to enable.\n\
719 Usage: enable mem <code number>...\n\
720 Do \"info mem\" to see current list of code numbers."), &enablelist);
721 
723 Disable memory region.\n\
724 Arguments are the code numbers of the memory regions to disable.\n\
725 Usage: disable mem <code number>...\n\
726 Do \"info mem\" to see current list of code numbers."), &disablelist);
727 
729 Delete memory region.\n\
730 Arguments are the code numbers of the memory regions to delete.\n\
731 Usage: delete mem <code number>...\n\
732 Do \"info mem\" to see current list of code numbers."), &deletelist);
733 
734  add_info ("mem", mem_info_command,
735  _("Memory region attributes"));
736 
737  add_prefix_cmd ("mem", class_vars, dummy_cmd, _("\
738 Memory regions settings"),
739  &mem_set_cmdlist, "set mem ",
740  0/* allow-unknown */, &setlist);
741  add_prefix_cmd ("mem", class_vars, dummy_cmd, _("\
742 Memory regions settings"),
743  &mem_show_cmdlist, "show mem ",
744  0/* allow-unknown */, &showlist);
745 
746  add_setshow_boolean_cmd ("inaccessible-by-default", no_class,
747  &inaccessible_by_default, _("\
748 Set handling of unknown memory regions."), _("\
749 Show handling of unknown memory regions."), _("\
750 If on, and some memory map is defined, debugger will emit errors on\n\
751 accesses to memory not defined in the memory map. If off, accesses to all\n\
752 memory addresses will be allowed."),
753  NULL,
754  show_inaccessible_by_default,
755  &mem_set_cmdlist,
756  &mem_show_cmdlist);
757 }
void error_no_arg(const char *why)
Definition: cli-cmds.c:205
struct gdbarch * target_gdbarch(void)
Definition: gdbarch.c:5143
struct cmd_list_element * add_prefix_cmd(const char *name, enum command_class theclass, cmd_cfunc_ftype *fun, const char *doc, struct cmd_list_element **prefixlist, const char *prefixname, int allow_unknown, struct cmd_list_element **list)
Definition: cli-decode.c:338
static void mem_info_command(char *args, int from_tty)
Definition: memattr.c:412
Definition: memattr.h:29
bfd_vma CORE_ADDR
Definition: common-types.h:41
VEC(mem_region_s)
Definition: memattr.c:53
static void mem_enable(int num)
Definition: memattr.c:549
struct cmd_list_element * enablelist
Definition: cli-cmds.c:111
int enabled_p
Definition: memattr.h:89
void warning(const char *fmt,...)
Definition: errors.c:26
int query(const char *ctlstr,...)
Definition: utils.c:1364
struct ui_file * gdb_stdout
Definition: main.c:71
struct cmd_list_element * deletelist
Definition: cli-cmds.c:123
static void mem_disable(int num)
Definition: memattr.c:596
static void dummy_cmd(char *args, int from_tty)
Definition: memattr.c:695
#define VEC_lower_bound(T, V, O, LT)
Definition: vec.h:383
const struct mem_attrib default_mem_attrib
Definition: memattr.c:32
#define VEC_quick_push(T, V, O)
Definition: vec.h:249
#define _(String)
Definition: gdb_locale.h:40
static void require_user_regions(int from_tty)
Definition: memattr.c:127
tuple m
Definition: arm-linux.py:44
void mem_region_init(struct mem_region *newobj)
Definition: memattr.c:115
void printf_filtered(const char *format,...)
Definition: utils.c:2388
initialize_file_ftype _initialize_mem
CORE_ADDR lo
Definition: memattr.h:79
Definition: memattr.h:30
static struct cmd_list_element * mem_show_cmdlist
Definition: memattr.c:702
static void create_mem_region(CORE_ADDR lo, CORE_ADDR hi, const struct mem_attrib *attrib)
Definition: memattr.c:174
struct cmd_list_element * setlist
Definition: cli-cmds.c:135
#define VEC_iterate(T, V, I, P)
Definition: vec.h:165
int cache
Definition: memattr.h:66
void target_dcache_invalidate(void)
Definition: target-dcache.c:51
void initialize_file_ftype(void)
Definition: defs.h:281
static void mem_disable_command(char *args, int from_tty)
Definition: memattr.c:611
void fprintf_filtered(struct ui_file *stream, const char *format,...)
Definition: utils.c:2351
struct mem_region * lookup_mem_region(CORE_ADDR addr)
Definition: memattr.c:226
struct mem_attrib attrib
Definition: memattr.h:92
int hwbreak
Definition: memattr.h:63
struct cmd_list_element * showlist
Definition: cli-cmds.c:143
static int mem_region_lessthan(const struct mem_region *lhs, const struct mem_region *rhs)
Definition: memattr.c:89
struct cmd_list_element * add_cmd(const char *name, enum command_class theclass, cmd_cfunc_ftype *fun, const char *doc, struct cmd_list_element **list)
Definition: cli-decode.c:192
#define VEC_length(T, V)
Definition: vec.h:124
static void mem_delete(int num)
Definition: memattr.c:642
#define VEC_index(T, V, I)
Definition: vec.h:151
struct cmd_list_element * add_info(const char *name, cmd_cfunc_ftype *fun, const char *doc)
Definition: cli-decode.c:857
int gdbarch_addr_bit(struct gdbarch *gdbarch)
Definition: gdbarch.c:1707
#define VEC_alloc(T, N)
Definition: vec.h:173
void printf_unfiltered(const char *format,...)
Definition: utils.c:2399
int number
Definition: memattr.h:85
int blocksize
Definition: memattr.h:73
static struct cmd_list_element * mem_set_cmdlist
Definition: memattr.c:701
#define VEC_empty(T, V)
Definition: vec.h:132
Definition: value.c:172
struct cmd_list_element * disablelist
Definition: cli-cmds.c:115
static void mem_enable_command(char *args, int from_tty)
Definition: memattr.c:564
static void mem_delete_command(char *args, int from_tty)
Definition: memattr.c:667
static void mem_clear(void)
Definition: memattr.c:309
CORE_ADDR parse_and_eval_address(const char *exp)
Definition: eval.c:96
Definition: memattr.h:28
#define VEC_free(T, V)
Definition: vec.h:180
static void mem_command(char *args, int from_tty)
Definition: memattr.c:316
int verify
Definition: memattr.h:70
CORE_ADDR hi
Definition: memattr.h:82
#define VEC_safe_insert(T, V, I, O)
Definition: vec.h:327
void dont_repeat(void)
Definition: top.c:582
void gdb_flush(struct ui_file *file)
Definition: ui-file.c:192
int get_number_or_range(struct get_number_or_range_state *state)
Definition: cli-utils.c:142
void invalidate_target_mem_regions(void)
Definition: memattr.c:295
enum mem_access_width width
Definition: memattr.h:60
void error(const char *fmt,...)
Definition: errors.c:38
struct cmd_list_element * add_com(const char *name, enum command_class theclass, cmd_cfunc_ftype *fun, const char *doc)
Definition: cli-decode.c:873
void init_number_or_range(struct get_number_or_range_state *state, const char *string)
Definition: cli-utils.c:132
void add_setshow_boolean_cmd(const char *name, enum command_class theclass, int *var, const char *set_doc, const char *show_doc, const char *help_doc, cmd_sfunc_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
Definition: cli-decode.c:541
int mem_region_cmp(const void *untyped_lhs, const void *untyped_rhs)
Definition: memattr.c:99
enum mem_access_mode mode
Definition: memattr.h:58
#define VEC_ordered_remove(T, V, I)
Definition: vec.h:339
static void require_target_regions(void)
Definition: memattr.c:163