From af7f8f52dd6024951577cfc328c318fdd4089623 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Thu, 27 May 2021 13:59:00 -0400 Subject: gdb: make add_setshow commands return set_show_commands Some add_set_show commands return a single cmd_list_element, the one for the "set" command. A subsequent patch will need to access the show command's cmd_list_element as well. Change these functions to return a new structure type that holds both pointers. I initially only modified add_setshow_boolean_cmd (the one I needed), but I think it's better to change the whole chain to keep everything in sync. gdb/ChangeLog: * command.h (set_show_commands): New. (add_setshow_enum_cmd, add_setshow_auto_boolean_cmd, add_setshow_boolean_cmd, add_setshow_filename_cmd, add_setshow_string_cmd, add_setshow_string_noescape_cmd, add_setshow_optional_filename_cmd, add_setshow_integer_cmd, add_setshow_uinteger_cmd, add_setshow_zinteger_cmd, add_setshow_zuinteger_cmd, add_setshow_zuinteger_unlimited_cmd): Return set_show_commands. Adjust callers. * cli/cli-decode.c (add_setshow_cmd_full): Return set_show_commands, remove result parameters, adjust callers. Change-Id: I17492b01b76002d09effc84830f9c6db26f1db7a --- gdb/disasm.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'gdb/disasm.c') diff --git a/gdb/disasm.c b/gdb/disasm.c index 70c5422..7f730f6 100644 --- a/gdb/disasm.c +++ b/gdb/disasm.c @@ -1139,11 +1139,10 @@ void _initialize_disasm (); void _initialize_disasm () { - struct cmd_list_element *cmd; - /* Add the command that controls the disassembler options. */ - cmd = add_setshow_string_noescape_cmd ("disassembler-options", no_class, - &prospective_options, _("\ + set_show_commands set_show_disas_opts + = add_setshow_string_noescape_cmd ("disassembler-options", no_class, + &prospective_options, _("\ Set the disassembler options.\n\ Usage: set disassembler-options OPTION [,OPTION]...\n\n\ See: 'show disassembler-options' for valid option values."), _("\ @@ -1151,5 +1150,5 @@ Show the disassembler options."), NULL, set_disassembler_options_sfunc, show_disassembler_options_sfunc, &setlist, &showlist); - set_cmd_completer (cmd, disassembler_options_completer); + set_cmd_completer (set_show_disas_opts.set, disassembler_options_completer); } -- cgit v1.1