aboutsummaryrefslogtreecommitdiff
path: root/gdb/target-descriptions.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/target-descriptions.c
parent5ad2694b1ebe123ea92fcee094a69bcdc9769985 (diff)
downloadbinutils-f54bdb6d2799c658e076f10e42222949dc51032d.zip
binutils-f54bdb6d2799c658e076f10e42222949dc51032d.tar.gz
binutils-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/target-descriptions.c')
-rw-r--r--gdb/target-descriptions.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/gdb/target-descriptions.c b/gdb/target-descriptions.c
index 4587eca..de1d68c 100644
--- a/gdb/target-descriptions.c
+++ b/gdb/target-descriptions.c
@@ -1962,14 +1962,12 @@ _initialize_target_descriptions ()
tdesc_data = gdbarch_data_register_pre_init (tdesc_data_init);
- add_basic_prefix_cmd ("tdesc", class_maintenance, _("\
-Set target description specific variables."),
- &tdesc_set_cmdlist,
- 0 /* allow-unknown */, &setlist);
- add_show_prefix_cmd ("tdesc", class_maintenance, _("\
-Show target description specific variables."),
- &tdesc_show_cmdlist,
- 0 /* allow-unknown */, &showlist);
+ add_setshow_prefix_cmd ("tdesc", class_maintenance,
+ _("Set target description specific variables."),
+ _("Show target description specific variables."),
+ &tdesc_set_cmdlist, &tdesc_show_cmdlist,
+ &setlist, &showlist);
+
add_basic_prefix_cmd ("tdesc", class_maintenance, _("\
Unset target description specific variables."),
&tdesc_unset_cmdlist,