diff options
author | Simon Marchi <simon.marchi@polymtl.ca> | 2021-05-27 13:59:00 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@polymtl.ca> | 2021-05-27 14:00:07 -0400 |
commit | af7f8f52dd6024951577cfc328c318fdd4089623 (patch) | |
tree | e22264c4479004aef1f6ed7bbe609e3a0207009b /gdb/corefile.c | |
parent | 868027a48b613b9024a0da835b920a6e2ec2528c (diff) | |
download | gdb-af7f8f52dd6024951577cfc328c318fdd4089623.zip gdb-af7f8f52dd6024951577cfc328c318fdd4089623.tar.gz gdb-af7f8f52dd6024951577cfc328c318fdd4089623.tar.bz2 |
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
Diffstat (limited to 'gdb/corefile.c')
-rw-r--r-- | gdb/corefile.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/gdb/corefile.c b/gdb/corefile.c index 30960c1..ddaa772 100644 --- a/gdb/corefile.c +++ b/gdb/corefile.c @@ -458,17 +458,17 @@ void _initialize_core (); void _initialize_core () { - struct cmd_list_element *c; - - c = add_cmd ("core-file", class_files, core_file_command, _("\ + cmd_list_element *core_file_cmd + = add_cmd ("core-file", class_files, core_file_command, _("\ Use FILE as core dump for examining memory and registers.\n\ Usage: core-file FILE\n\ No arg means have no core file. This command has been superseded by the\n\ `target core' and `detach' commands."), &cmdlist); - set_cmd_completer (c, filename_completer); + set_cmd_completer (core_file_cmd, filename_completer); - c = add_setshow_string_noescape_cmd ("gnutarget", class_files, + set_show_commands set_show_gnutarget + = add_setshow_string_noescape_cmd ("gnutarget", class_files, &gnutarget_string, _("\ Set the current BFD target."), _("\ Show the current BFD target."), _("\ @@ -476,7 +476,7 @@ Use `set gnutarget auto' to specify automatic detection."), set_gnutarget_command, show_gnutarget_string, &setlist, &showlist); - set_cmd_completer (c, complete_set_gnutarget); + set_cmd_completer (set_show_gnutarget.set, complete_set_gnutarget); add_alias_cmd ("g", "gnutarget", class_files, 1, &setlist); |