63 gdb_printf (file, _(
"Unknown memory addresses will "
64 "be treated as inaccessible.\n"));
66 gdb_printf (file, _(
"Unknown memory addresses "
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)
124 gdb_printf (_(
"invalid memory region: low >= high\n"));
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)))
151 gdb_printf (_(
"overlapping memory region\n"));
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 ());
342 gdb_printf (_(
"Using memory regions provided by the target.\n"));
344 gdb_printf (_(
"Using user-defined memory regions.\n"));
350 gdb_printf (_(
"There are no memory regions defined.\n"));
371 m.enabled_p ?
'y' :
'n');
373 tmp = hex_string_custom (m.lo, 8);
375 tmp = hex_string_custom (m.lo, 16);
384 tmp = hex_string_custom (m.hi, 8);
389 tmp =
"0x10000000000000000";
391 tmp = hex_string_custom (m.hi, 16);
408 switch (m.attrib.mode)
420 gdb_printf (
"flash blocksize 0x%x ", m.attrib.blocksize);
424 switch (m.attrib.width)
477 gdb_printf (_(
"No memory region number %d.\n"), num);
487 if (args == NULL || *args ==
'\0')
515 gdb_printf (_(
"No memory region number %d.\n"), num);
525 if (args == NULL || *args ==
'\0')
548 gdb_printf (_(
"No memory region number %d.\n"), num);
555 return m.number == num;
561 gdb_printf (_(
"No memory region number %d.\n"), num);
571 if (args == NULL || *args ==
'\0')
573 if (
query (_(
"Delete all memory regions? ")))
597Define attributes for memory region or reset memory region handling to "
600 mem LOW HIGH [MODE WIDTH CACHE],\n\
601where MODE may be rw (read/write), ro (read-only) or wo (write-only),\n\
602 WIDTH may be 8, 16, 32, or 64, and\n\
603 CACHE may be cache or nocache"));
606Enable memory region.\n\
607Arguments are the IDs of the memory regions to enable.\n\
608Usage: enable mem [ID]...\n\
609Do \"info mem\" to see current list of IDs."), &
enablelist);
612Disable memory region.\n\
613Arguments are the IDs of the memory regions to disable.\n\
614Usage: disable mem [ID]...\n\
615Do \"info mem\" to see current list of IDs."), &
disablelist);
618Delete memory region.\n\
619Arguments are the IDs of the memory regions to delete.\n\
620Usage: delete mem [ID]...\n\
621Do \"info mem\" to see current list of IDs."), &
deletelist);
624 _(
"Memory region attributes."));
627 _(
"Memory regions settings."),
628 _(
"Memory regions settings."),
634Set handling of unknown memory regions."), _(
"\
635Show handling of unknown memory regions."), _(
"\
636If on, and some memory map is defined, debugger will emit errors on\n\
637accesses to memory not defined in the memory map. If off, accesses to all\n\
638memory addresses will be allowed."),
struct gdbarch * target_gdbarch(void)
struct cmd_list_element * showlist
struct cmd_list_element * deletelist
void error_no_arg(const char *why)
struct cmd_list_element * setlist
struct cmd_list_element * disablelist
struct cmd_list_element * enablelist
struct cmd_list_element * add_cmd(const char *name, enum command_class theclass, const char *doc, struct cmd_list_element **list)
struct cmd_list_element * add_com(const char *name, enum command_class theclass, cmd_simple_func_ftype *fun, const char *doc)
set_show_commands add_setshow_prefix_cmd(const char *name, command_class theclass, const char *set_doc, const char *show_doc, cmd_list_element **set_subcommands_list, cmd_list_element **show_subcommands_list, cmd_list_element **set_list, cmd_list_element **show_list)
set_show_commands add_setshow_boolean_cmd(const char *name, enum command_class theclass, bool *var, const char *set_doc, const char *show_doc, const char *help_doc, cmd_func_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
struct cmd_list_element * add_info(const char *name, cmd_simple_func_ftype *fun, const char *doc)
std::string extract_arg(const char **arg)
CORE_ADDR parse_and_eval_address(const char *exp)
int gdbarch_addr_bit(struct gdbarch *gdbarch)
static void enable_mem_command(const char *args, int from_tty)
static void require_target_regions(void)
struct mem_region * lookup_mem_region(CORE_ADDR addr)
static void delete_mem_command(const char *args, int from_tty)
static bool target_mem_regions_valid
static void user_mem_clear(void)
static void mem_command(const char *args, int from_tty)
static std::vector< mem_region > * mem_region_list
static std::vector< mem_region > target_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 std::vector< mem_region > user_mem_region_list
static void disable_mem_command(const char *args, int from_tty)
static struct cmd_list_element * mem_show_cmdlist
static void mem_enable(int num)
static void mem_delete(int num)
static bool inaccessible_by_default
static void mem_disable(int num)
static void info_mem_command(const char *args, int from_tty)
static struct cmd_list_element * mem_set_cmdlist
void invalidate_target_mem_regions(void)
static void create_user_mem_region(CORE_ADDR lo, CORE_ADDR hi, const mem_attrib &attrib)
static void require_user_regions(int from_tty)
static bool mem_use_target()
enum mem_access_mode mode
static mem_attrib unknown()
enum mem_access_width width
void target_dcache_invalidate(void)
std::vector< mem_region > target_memory_map(void)
int query(const char *ctlstr,...)
void gdb_printf(struct ui_file *stream, const char *format,...)