aboutsummaryrefslogtreecommitdiff
path: root/gdb/i386-tdep.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2021-09-22 13:43:25 -0400
committerSimon Marchi <simon.marchi@efficios.com>2021-10-28 10:44:18 -0400
commitf54bdb6d2799c658e076f10e42222949dc51032d (patch)
treebd9804255bf472e93740a8b47b2f90d5bde939c3 /gdb/i386-tdep.c
parent5ad2694b1ebe123ea92fcee094a69bcdc9769985 (diff)
downloadfsf-binutils-gdb-f54bdb6d2799c658e076f10e42222949dc51032d.zip
fsf-binutils-gdb-f54bdb6d2799c658e076f10e42222949dc51032d.tar.gz
fsf-binutils-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/i386-tdep.c')
-rw-r--r--gdb/i386-tdep.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
index 23dc39a..f65a074 100644
--- a/gdb/i386-tdep.c
+++ b/gdb/i386-tdep.c
@@ -9043,19 +9043,13 @@ is \"default\"."),
NULL, /* FIXME: i18n: */
&setlist, &showlist);
- /* Add "mpx" prefix for the set commands. */
+ /* Add "mpx" prefix for the set and show commands. */
- add_basic_prefix_cmd ("mpx", class_support, _("\
-Set Intel Memory Protection Extensions specific variables."),
- &mpx_set_cmdlist,
- 0 /* allow-unknown */, &setlist);
-
- /* Add "mpx" prefix for the show commands. */
-
- add_show_prefix_cmd ("mpx", class_support, _("\
-Show Intel Memory Protection Extensions specific variables."),
- &mpx_show_cmdlist,
- 0 /* allow-unknown */, &showlist);
+ add_setshow_prefix_cmd
+ ("mpx", class_support,
+ _("Set Intel Memory Protection Extensions specific variables."),
+ _("Show Intel Memory Protection Extensions specific variables."),
+ &mpx_set_cmdlist, &mpx_show_cmdlist, &setlist, &showlist);
/* Add "bound" command for the show mpx commands list. */