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 | 9f26053690299e3a5d295d78c4ceeaf840344f0b (patch) | |
tree | 27cc770378c9ae45c0c723f2401b24af26079550 /gdb/remote.c | |
parent | af7f8f52dd6024951577cfc328c318fdd4089623 (diff) | |
download | binutils-gdb-9f26053690299e3a5d295d78c4ceeaf840344f0b.tar.gz |
gdb: remove unnecessary lookup_cmd when deprecating commands
Remove a few instances where we look up a command by name, but could
just use the return value of a previous "add command" function call
instead.
gdb/ChangeLog:
* mi/mi-main.c (_initialize_mi_main):
* python/py-auto-load.c (gdbpy_initialize_auto_load):
* remote.c (_initialize_remote):
Change-Id: I6d06f9ca636e340c88c1064ae870483ad392607d
Diffstat (limited to 'gdb/remote.c')
-rw-r--r-- | gdb/remote.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/gdb/remote.c b/gdb/remote.c index aa98f5f951e..f2cb35116c8 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -14828,9 +14828,6 @@ void _initialize_remote (); void _initialize_remote () { - struct cmd_list_element *cmd; - const char *cmd_name; - /* architecture specific data */ remote_g_packet_data_handle = gdbarch_data_register_pre_init (remote_g_packet_data_init); @@ -14875,18 +14872,15 @@ response packet. GDB supplies the initial `$' character, and the\n\ terminating `#' character and checksum."), &maintenancelist); - add_setshow_boolean_cmd ("remotebreak", no_class, &remote_break, _("\ + set_show_commands remotebreak_cmds + = add_setshow_boolean_cmd ("remotebreak", no_class, &remote_break, _("\ Set whether to send break if interrupted."), _("\ Show whether to send break if interrupted."), _("\ If set, a break, instead of a cntrl-c, is sent to the remote target."), - set_remotebreak, show_remotebreak, - &setlist, &showlist); - cmd_name = "remotebreak"; - cmd = lookup_cmd (&cmd_name, setlist, "", NULL, -1, 1); - deprecate_cmd (cmd, "set remote interrupt-sequence"); - cmd_name = "remotebreak"; /* needed because lookup_cmd updates the pointer */ - cmd = lookup_cmd (&cmd_name, showlist, "", NULL, -1, 1); - deprecate_cmd (cmd, "show remote interrupt-sequence"); + set_remotebreak, show_remotebreak, + &setlist, &showlist); + deprecate_cmd (remotebreak_cmds.set, "set remote interrupt-sequence"); + deprecate_cmd (remotebreak_cmds.show, "show remote interrupt-sequence"); add_setshow_enum_cmd ("interrupt-sequence", class_support, interrupt_sequence_modes, &interrupt_sequence_mode, |