aboutsummaryrefslogtreecommitdiff
path: root/gdb/riscv-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/riscv-tdep.c
parent5ad2694b1ebe123ea92fcee094a69bcdc9769985 (diff)
downloadgdb-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/riscv-tdep.c')
-rw-r--r--gdb/riscv-tdep.c26
1 files changed, 10 insertions, 16 deletions
diff --git a/gdb/riscv-tdep.c b/gdb/riscv-tdep.c
index 4b92754..4c2557f 100644
--- a/gdb/riscv-tdep.c
+++ b/gdb/riscv-tdep.c
@@ -4018,15 +4018,11 @@ _initialize_riscv_tdep ()
/* Add root prefix command for all "set debug riscv" and "show debug
riscv" commands. */
- add_basic_prefix_cmd ("riscv", no_class,
- _("RISC-V specific debug commands."),
- &setdebugriscvcmdlist, 0,
- &setdebuglist);
-
- add_show_prefix_cmd ("riscv", no_class,
- _("RISC-V specific debug commands."),
- &showdebugriscvcmdlist, 0,
- &showdebuglist);
+ add_setshow_prefix_cmd ("riscv", no_class,
+ _("RISC-V specific debug commands."),
+ _("RISC-V specific debug commands."),
+ &setdebugriscvcmdlist, &showdebugriscvcmdlist,
+ &setdebuglist, &showdebuglist);
add_setshow_zuinteger_cmd ("breakpoints", class_maintenance,
&riscv_debug_breakpoints, _("\
@@ -4069,13 +4065,11 @@ initialisation process."),
&setdebugriscvcmdlist, &showdebugriscvcmdlist);
/* Add root prefix command for all "set riscv" and "show riscv" commands. */
- add_basic_prefix_cmd ("riscv", no_class,
- _("RISC-V specific commands."),
- &setriscvcmdlist, 0, &setlist);
-
- add_show_prefix_cmd ("riscv", no_class,
- _("RISC-V specific commands."),
- &showriscvcmdlist, 0, &showlist);
+ add_setshow_prefix_cmd ("riscv", no_class,
+ _("RISC-V specific commands."),
+ _("RISC-V specific commands."),
+ &setriscvcmdlist, &showriscvcmdlist,
+ &setlist, &showlist);
use_compressed_breakpoints = AUTO_BOOLEAN_AUTO;