diff options
author | Simon Marchi <simon.marchi@polymtl.ca> | 2021-09-22 13:43:25 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@efficios.com> | 2021-10-28 10:44:18 -0400 |
commit | f54bdb6d2799c658e076f10e42222949dc51032d (patch) | |
tree | bd9804255bf472e93740a8b47b2f90d5bde939c3 /gdb/typeprint.c | |
parent | 5ad2694b1ebe123ea92fcee094a69bcdc9769985 (diff) | |
download | fsf-binutils-gdb-f54bdb6d2799c658e076f10e42222949dc51032d.zip fsf-binutils-gdb-f54bdb6d2799c658e076f10e42222949dc51032d.tar.gz fsf-binutils-gdb-f54bdb6d2799c658e076f10e42222949dc51032d.tar.bz2 |
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
Diffstat (limited to 'gdb/typeprint.c')
-rw-r--r-- | gdb/typeprint.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/gdb/typeprint.c b/gdb/typeprint.c index 0d73baa..8ca3d3e 100644 --- a/gdb/typeprint.c +++ b/gdb/typeprint.c @@ -851,12 +851,11 @@ Available FLAGS are:\n\ Only one level of typedefs is unrolled. See also \"ptype\".")); set_cmd_completer (c, expression_completer); - add_show_prefix_cmd ("type", no_class, - _("Generic command for showing type-printing settings."), - &showprinttypelist, 0, &showprintlist); - add_basic_prefix_cmd ("type", no_class, - _("Generic command for setting how types print."), - &setprinttypelist, 0, &setprintlist); + add_setshow_prefix_cmd ("type", no_class, + _("Generic command for showing type-printing settings."), + _("Generic command for setting how types print."), + &setprinttypelist, &showprinttypelist, + &setprintlist, &showprintlist); add_setshow_boolean_cmd ("methods", no_class, &print_methods, _("\ |