64 "be treated as inaccessible.\n"));
67 "will be treated as RAM.\n"));
92 warning (
_(
"Switching to manual control of memory regions; use " 93 "\"mem auto\" to fetch regions from the target again."));
122 if (lo >= hi && hi != 0)
138 for (
int i = ix - 1; i < ix + 1; i++)
147 if ((lo >= n.
lo && (lo < n.
hi || n.
hi == 0))
148 || (hi > n.
lo && (hi <= n.
hi || n.
hi == 0))
149 || (lo <= n.
lo && ((hi >= n.
hi && n.
hi != 0) || hi == 0)))
190 if (
m.enabled_p == 1)
194 if (addr >=
m.lo && (addr <
m.hi ||
m.hi == 0))
200 if (addr >=
m.hi &&
lo <
m.hi)
206 if (addr <=
m.lo && (
hi == 0 ||
hi >
m.lo))
257 if (strcmp (args,
"auto") == 0)
272 error (
_(
"no lo address"));
277 error (
_(
"no hi address"));
285 else if (tok ==
"ro")
287 else if (tok ==
"wo")
292 else if (tok ==
"16")
294 if ((
lo % 2 != 0) || (
hi % 2 != 0))
295 error (
_(
"region bounds not 16 bit aligned"));
298 else if (tok ==
"32")
300 if ((
lo % 4 != 0) || (
hi % 4 != 0))
301 error (
_(
"region bounds not 32 bit aligned"));
304 else if (tok ==
"64")
306 if ((
lo % 8 != 0) || (
hi % 8 != 0))
307 error (
_(
"region bounds not 64 bit aligned"));
312 else if (tok ==
"hwbreak")
314 else if (tok ==
"swbreak")
318 else if (tok ==
"cache")
320 else if (tok ==
"nocache")
324 else if (tok ==
"verify")
326 else if (tok ==
"noverify")
331 error (
_(
"unknown attribute: %s"), tok.c_str ());
371 m.enabled_p ?
'y' :
'n');
389 tmp =
"0x10000000000000000";
408 switch (
m.attrib.mode)
424 switch (
m.attrib.width)
489 if (args == NULL || *args ==
'\0')
527 if (args == NULL || *args ==
'\0')
557 return m.number == num;
573 if (args == NULL || *args ==
'\0')
575 if (
query (
_(
"Delete all memory regions? ")))
603 Define attributes for memory region or reset memory region handling to\n\ 606 mem <lo addr> <hi addr> [<mode> <width> <cache>],\n\ 607 where <mode> may be rw (read/write), ro (read-only) or wo (write-only),\n\ 608 <width> may be 8, 16, 32, or 64, and\n\ 609 <cache> may be cache or nocache"));
612 Enable memory region.\n\ 613 Arguments are the code numbers of the memory regions to enable.\n\ 614 Usage: enable mem <code number>...\n\ 615 Do \"info mem\" to see current list of code numbers."), &
enablelist);
618 Disable memory region.\n\ 619 Arguments are the code numbers of the memory regions to disable.\n\ 620 Usage: disable mem <code number>...\n\ 621 Do \"info mem\" to see current list of code numbers."), &
disablelist);
624 Delete memory region.\n\ 625 Arguments are the code numbers of the memory regions to delete.\n\ 626 Usage: delete mem <code number>...\n\ 627 Do \"info mem\" to see current list of code numbers."), &
deletelist);
630 _(
"Memory region attributes"));
633 Memory regions settings"),
637 Memory regions settings"),
643 Set handling of unknown memory regions."),
_(
"\ 644 Show handling of unknown memory regions."),
_(
"\ 645 If on, and some memory map is defined, debugger will emit errors on\n\ 646 accesses to memory not defined in the memory map. If off, accesses to all\n\ 647 memory addresses will be allowed."),
void error_no_arg(const char *why)
struct gdbarch * target_gdbarch(void)
static void enable_mem_command(const char *args, int from_tty)
static mem_attrib unknown()
static void mem_enable(int num)
struct cmd_list_element * enablelist
void warning(const char *fmt,...)
int query(const char *ctlstr,...)
std::string extract_arg(const char **arg)
struct cmd_list_element * add_info(const char *name, cmd_const_cfunc_ftype *fun, const char *doc)
static void info_mem_command(const char *args, int from_tty)
struct cmd_list_element * deletelist
static void mem_disable(int num)
struct cmd_list_element * add_cmd(const char *name, enum command_class theclass, const char *doc, struct cmd_list_element **list)
static std::vector< mem_region > user_mem_region_list
static void show_inaccessible_by_default(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
static void require_user_regions(int from_tty)
void printf_filtered(const char *format,...)
void _initialize_mem(void)
static struct cmd_list_element * mem_show_cmdlist
struct cmd_list_element * add_prefix_cmd(const char *name, enum command_class theclass, cmd_const_cfunc_ftype *fun, const char *doc, struct cmd_list_element **prefixlist, const char *prefixname, int allow_unknown, struct cmd_list_element **list)
struct cmd_list_element * setlist
std::vector< mem_region > target_memory_map(void)
static void dummy_cmd(const char *args, int from_tty)
static void create_user_mem_region(CORE_ADDR lo, CORE_ADDR hi, const mem_attrib &attrib)
void target_dcache_invalidate(void)
void fprintf_filtered(struct ui_file *stream, const char *format,...)
struct mem_region * lookup_mem_region(CORE_ADDR addr)
struct cmd_list_element * showlist
static std::vector< mem_region > target_mem_region_list
static void mem_delete(int num)
int gdbarch_addr_bit(struct gdbarch *gdbarch)
void printf_unfiltered(const char *format,...)
static struct cmd_list_element * mem_set_cmdlist
struct cmd_list_element * disablelist
static void delete_mem_command(const char *args, int from_tty)
char * hex_string_custom(LONGEST num, int width)
static std::vector< mem_region > * mem_region_list
CORE_ADDR parse_and_eval_address(const char *exp)
static bool mem_use_target()
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_const_sfunc_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
static void user_mem_clear(void)
static void disable_mem_command(const char *args, int from_tty)
static bool target_mem_regions_valid
static void mem_command(const char *args, int from_tty)
void gdb_flush(struct ui_file *file)
struct cmd_list_element * add_com(const char *name, enum command_class theclass, cmd_const_cfunc_ftype *fun, const char *doc)
void invalidate_target_mem_regions(void)
enum mem_access_width width
void error(const char *fmt,...)
static int inaccessible_by_default
enum mem_access_mode mode
static void require_target_regions(void)