From f54bdb6d2799c658e076f10e42222949dc51032d Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Wed, 22 Sep 2021 13:43:25 -0400 Subject: 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 --- gdb/mips-tdep.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'gdb/mips-tdep.c') diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c index 57295d6..d9f8652 100644 --- a/gdb/mips-tdep.c +++ b/gdb/mips-tdep.c @@ -8942,13 +8942,11 @@ _initialize_mips_tdep () set_tdesc_property (mips_tdesc_gp64, PROPERTY_GP64, ""); /* Add root prefix command for all "set mips"/"show mips" commands. */ - add_basic_prefix_cmd ("mips", no_class, - _("Various MIPS specific commands."), - &setmipscmdlist, 0, &setlist); - - add_show_prefix_cmd ("mips", no_class, - _("Various MIPS specific commands."), - &showmipscmdlist, 0, &showlist); + add_setshow_prefix_cmd ("mips", no_class, + _("Various MIPS specific commands."), + _("Various MIPS specific commands."), + &setmipscmdlist, &showmipscmdlist, + &setlist, &showlist); /* Allow the user to override the ABI. */ add_setshow_enum_cmd ("abi", class_obscure, mips_abi_strings, -- cgit v1.1