From 1517056850dfb18e2b5d8301b93a3d5e5ef3a42a Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Fri, 7 May 2004 13:35:52 +0000 Subject: [PATCH] 2004-05-07 Andrew Cagney * cli/cli-decode.c (add_setshow_zinteger_cmd): New function. * command.h (add_setshow_zinteger_cmd): Declare. --- gdb/ChangeLog | 5 +++++ gdb/cli/cli-decode.c | 20 ++++++++++++++++++++ gdb/command.h | 10 ++++++++++ 3 files changed, 35 insertions(+) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index c85695b..e40321b 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2004-05-07 Andrew Cagney + + * cli/cli-decode.c (add_setshow_zinteger_cmd): New function. + * command.h (add_setshow_zinteger_cmd): Declare. + 2004-05-06 Randolph Chung * config/pa/tm-hppa.h (RO_REGNUM, FLAGS_REGNUM, RP_REGNUM) diff --git a/gdb/cli/cli-decode.c b/gdb/cli/cli-decode.c index 43f2f25..879d7b4 100644 --- a/gdb/cli/cli-decode.c +++ b/gdb/cli/cli-decode.c @@ -472,6 +472,26 @@ add_setshow_uinteger_cmd (char *name, NULL, NULL); } +/* Add element named NAME to both the set and show command LISTs (the + list for set/show or some sublist thereof). CLASS is as in + add_cmd. VAR is address of the variable which will contain the + value. SET_DOC and SHOW_DOR are the documentation strings. */ +void +add_setshow_zinteger_cmd (char *name, + enum command_class class, + int *var, char *set_doc, char *show_doc, + cmd_sfunc_ftype *set_func, + cmd_sfunc_ftype *show_func, + struct cmd_list_element **set_list, + struct cmd_list_element **show_list) +{ + add_setshow_cmd_full (name, class, var_zinteger, var, + set_doc, show_doc, + set_func, show_func, + set_list, show_list, + NULL, NULL); +} + /* Where SETCMD has already been added, add the corresponding show command to LIST and return a pointer to the added command (not necessarily the head of LIST). */ diff --git a/gdb/command.h b/gdb/command.h index c4a5f20..d441a7f 100644 --- a/gdb/command.h +++ b/gdb/command.h @@ -272,6 +272,16 @@ extern void add_setshow_uinteger_cmd (char *name, struct cmd_list_element **set_list, struct cmd_list_element **show_list); +extern void add_setshow_zinteger_cmd (char *name, + enum command_class class, + int *var, + char *set_doc, + char *show_doc, + cmd_sfunc_ftype *set_func, + cmd_sfunc_ftype *show_func, + struct cmd_list_element **set_list, + struct cmd_list_element **show_list); + extern struct cmd_list_element *add_show_from_set (struct cmd_list_element *, struct cmd_list_element **); -- 2.7.4