mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-19 09:14:14 +08:00
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
This commit is contained in:

committed by
Simon Marchi

parent
5ad2694b1e
commit
f54bdb6d27
10
gdb/utils.c
10
gdb/utils.c
@ -539,13 +539,9 @@ add_internal_problem_command (struct internal_problem *problem)
|
||||
= xstrprintf (_("Show what GDB does when %s is detected."),
|
||||
problem->name);
|
||||
|
||||
add_basic_prefix_cmd (problem->name, class_maintenance, set_doc,
|
||||
set_cmd_list,
|
||||
0/*allow-unknown*/, &maintenance_set_cmdlist);
|
||||
|
||||
add_show_prefix_cmd (problem->name, class_maintenance, show_doc,
|
||||
show_cmd_list,
|
||||
0/*allow-unknown*/, &maintenance_show_cmdlist);
|
||||
add_setshow_prefix_cmd (problem->name, class_maintenance,
|
||||
set_doc, show_doc, set_cmd_list, show_cmd_list,
|
||||
&maintenance_set_cmdlist, &maintenance_show_cmdlist);
|
||||
|
||||
if (problem->user_settable_should_quit)
|
||||
{
|
||||
|
Reference in New Issue
Block a user