diff options
author | Tom Tromey <tom@tromey.com> | 2025-01-11 13:50:50 -0700 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2025-01-29 10:21:49 -0700 |
commit | af16bf565f83e1fd71d6acfed05d670993528a0d (patch) | |
tree | dd34ef6526488fe6005067ca30581b48a9c4a6f0 /gdb/source.c | |
parent | 7a3e81eaa4a6ab84b6b477f88f382b7e65fcfcee (diff) | |
download | binutils-af16bf565f83e1fd71d6acfed05d670993528a0d.zip binutils-af16bf565f83e1fd71d6acfed05d670993528a0d.tar.gz binutils-af16bf565f83e1fd71d6acfed05d670993528a0d.tar.bz2 |
Avoid calling help_list in more places
I think there is no need to have a prefix command that simply calls
help_list. Instead, add_basic_prefix_cmd can be used. This patch
changes the relevant instances. In one spot, add_setshow_prefix_cmd
is used instead.
Diffstat (limited to 'gdb/source.c')
-rw-r--r-- | gdb/source.c | 29 |
1 files changed, 6 insertions, 23 deletions
diff --git a/gdb/source.c b/gdb/source.c index a225280..0d6523c 100644 --- a/gdb/source.c +++ b/gdb/source.c @@ -1909,22 +1909,6 @@ source_lines_range::source_lines_range (int startline, } } -/* Handle the "set source" base command. */ - -static void -set_source (const char *arg, int from_tty) -{ - help_list (setsourcelist, "set source ", all_commands, gdb_stdout); -} - -/* Handle the "show source" base command. */ - -static void -show_source (const char *args, int from_tty) -{ - help_list (showsourcelist, "show source ", all_commands, gdb_stdout); -} - void _initialize_source (); void @@ -2045,13 +2029,12 @@ By default, relative filenames are displayed."), show_filename_display_string, &setlist, &showlist); - add_prefix_cmd ("source", no_class, set_source, - _("Generic command for setting how sources are handled."), - &setsourcelist, 0, &setlist); - - add_prefix_cmd ("source", no_class, show_source, - _("Generic command for showing source settings."), - &showsourcelist, 0, &showlist); + add_setshow_prefix_cmd + ("source", no_class, + _("Generic command for setting how sources are handled."), + _("Generic command for showing source settings."), + &setsourcelist, &showsourcelist, + &setlist, &showlist); add_setshow_boolean_cmd ("open", class_files, &source_open, _("\ Set whether GDB should open source files."), _("\ |