/* Memory attributes support, for GDB.
- Copyright (C) 2001-2019 Free Software Foundation, Inc.
+ Copyright (C) 2001-2021 Free Software Foundation, Inc.
This file is part of GDB.
#include "target-dcache.h"
#include "value.h"
#include "language.h"
-#include "gdbsupport/vec.h"
#include "breakpoint.h"
#include "cli/cli-utils.h"
#include <algorithm>
/* If this flag is set, gdb will assume that memory ranges not
specified by the memory map have type MEM_NONE, and will
emit errors on all accesses to that memory. */
-static int inaccessible_by_default = 1;
+static bool inaccessible_by_default = true;
static void
show_inaccessible_by_default (struct ui_file *file, int from_tty,
int ix = std::distance (user_mem_region_list.begin (), it);
/* Check for an overlapping memory region. We only need to check
- in the vicinity - at most one before and one after the
+ in the vincinity - at most one before and one after the
insertion point. */
for (int i = ix - 1; i < ix + 1; i++)
{
dont_repeat ();
}
-static void
-dummy_cmd (const char *args, int from_tty)
-{
-}
-
static struct cmd_list_element *mem_set_cmdlist;
static struct cmd_list_element *mem_show_cmdlist;
+void _initialize_mem ();
void
-_initialize_mem (void)
+_initialize_mem ()
{
add_com ("mem", class_vars, mem_command, _("\
Define attributes for memory region or reset memory region handling to "
add_info ("mem", info_mem_command,
_("Memory region attributes."));
- add_prefix_cmd ("mem", class_vars, dummy_cmd, _("\
+ add_basic_prefix_cmd ("mem", class_vars, _("\
Memory regions settings."),
- &mem_set_cmdlist, "set mem ",
- 0/* allow-unknown */, &setlist);
- add_prefix_cmd ("mem", class_vars, dummy_cmd, _("\
+ &mem_set_cmdlist, "set mem ",
+ 0/* allow-unknown */, &setlist);
+ add_show_prefix_cmd ("mem", class_vars, _("\
Memory regions settings."),
- &mem_show_cmdlist, "show mem ",
- 0/* allow-unknown */, &showlist);
+ &mem_show_cmdlist, "show mem ",
+ 0/* allow-unknown */, &showlist);
add_setshow_boolean_cmd ("inaccessible-by-default", no_class,
&inaccessible_by_default, _("\