diff options
author | Simon Marchi <simon.marchi@polymtl.ca> | 2021-09-22 13:43:25 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@efficios.com> | 2021-10-28 10:44:18 -0400 |
commit | f54bdb6d2799c658e076f10e42222949dc51032d (patch) | |
tree | bd9804255bf472e93740a8b47b2f90d5bde939c3 /gdb/memattr.c | |
parent | 5ad2694b1ebe123ea92fcee094a69bcdc9769985 (diff) | |
download | gdb-f54bdb6d2799c658e076f10e42222949dc51032d.zip gdb-f54bdb6d2799c658e076f10e42222949dc51032d.tar.gz gdb-f54bdb6d2799c658e076f10e42222949dc51032d.tar.bz2 |
gdb: add add_setshow_prefix_cmd
There's a common pattern to call add_basic_prefix_cmd and
add_show_prefix_cmd to add matching set and show commands. Add the
add_setshow_prefix_cmd function to factor that out and use it at a few
places.
Change-Id: I6e9e90a30e9efb7b255bf839cac27b85d7069cfd
Diffstat (limited to 'gdb/memattr.c')
-rw-r--r-- | gdb/memattr.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/gdb/memattr.c b/gdb/memattr.c index e1c3931..c163ac0 100644 --- a/gdb/memattr.c +++ b/gdb/memattr.c @@ -623,14 +623,11 @@ Do \"info mem\" to see current list of IDs."), &deletelist); add_info ("mem", info_mem_command, _("Memory region attributes.")); - add_basic_prefix_cmd ("mem", class_vars, _("\ -Memory regions settings."), - &mem_set_cmdlist, - 0/* allow-unknown */, &setlist); - add_show_prefix_cmd ("mem", class_vars, _("\ -Memory regions settings."), - &mem_show_cmdlist, - 0/* allow-unknown */, &showlist); + add_setshow_prefix_cmd ("mem", class_vars, + _("Memory regions settings."), + _("Memory regions settings."), + &mem_set_cmdlist, &mem_show_cmdlist, + &setlist, &showlist); add_setshow_boolean_cmd ("inaccessible-by-default", no_class, &inaccessible_by_default, _("\ |