From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10589 invoked by alias); 28 Jul 2004 19:45:54 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 10297 invoked from network); 28 Jul 2004 19:45:50 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 28 Jul 2004 19:45:50 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.10/8.12.10) with ESMTP id i6SJjne3004127 for ; Wed, 28 Jul 2004 15:45:50 -0400 Received: from localhost.redhat.com (porkchop.devel.redhat.com [172.16.58.2]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i6SJjna03630; Wed, 28 Jul 2004 15:45:49 -0400 Received: from gnu.org (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 3BEDD2B9D; Wed, 28 Jul 2004 15:45:45 -0400 (EDT) Message-ID: <41080269.5000100@gnu.org> Date: Wed, 28 Jul 2004 19:45:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-GB; rv:1.4.1) Gecko/20040217 MIME-Version: 1.0 To: gdb-patches@sources.redhat.com Subject: [commit] Eliminate add_setshow_cmd Content-Type: multipart/mixed; boundary="------------030003060504010607040308" X-SW-Source: 2004-07/txt/msg00429.txt.bz2 This is a multi-part message in MIME format. --------------030003060504010607040308 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-length: 210 Hello, This patch eliminates add_setshow_cmd replacing it with the more formally typed add_setshow_string_cmd and add_setshow_filename_cmd (also add_setshow_zinteger_cmd in a few places). committed, Andrew --------------030003060504010607040308 Content-Type: text/plain; name="diffs" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="diffs" Content-length: 13935 2004-07-28 Andrew Cagney * cli/cli-decode.c (add_setshow_cmd): Delete function. (add_setshow_cmd_full): Make static. * command.h (add_setshow_cmd, add_setshow_cmd_full): Delete. (add_setshow_filename_cmd, add_setshow_string_cmd): Declare. * cli/cli-decode.c (add_setshow_filename_cmd) (add_setshow_string_cmd): New functions. * nto-tdep.c (_initialize_nto_tdep): Update. Fix parameters. * mips-tdep.c (_initialize_mips_tdep): Update. * m32r-rom.c (_initialize_m32r_rom): Update. Update copyright. * cli/cli-logging.c (_initialize_cli_logging): Update. * complaints.c (_initialize_complaints): Update. * remote.c (_initialize_remote): Update. Index: command.h =================================================================== RCS file: /cvs/src/src/gdb/command.h,v retrieving revision 1.40 diff -p -u -r1.40 command.h --- command.h 28 Jul 2004 17:26:26 -0000 1.40 +++ command.h 28 Jul 2004 19:29:41 -0000 @@ -211,28 +211,6 @@ extern void help_list (struct cmd_list_e extern void help_cmd_list (struct cmd_list_element *, enum command_class, char *, int, struct ui_file *); -extern void add_setshow_cmd (char *name, - enum command_class class, - var_types var_type, void *var, - const char *set_doc, const char *show_doc, - const char *help_doc, const char *print, - cmd_sfunc_ftype *set_func, - cmd_sfunc_ftype *show_func, - struct cmd_list_element **set_list, - struct cmd_list_element **show_list); - -extern void add_setshow_cmd_full (char *name, - enum command_class class, - var_types var_type, void *var, - const char *set_doc, const char *show_doc, - const char *help_doc, const char *print, - cmd_sfunc_ftype *set_func, - cmd_sfunc_ftype *show_func, - struct cmd_list_element **set_list, - struct cmd_list_element **show_list, - struct cmd_list_element **set_result, - struct cmd_list_element **show_result); - extern struct cmd_list_element *add_set_cmd (char *name, enum command_class class, var_types var_type, void *var, @@ -268,6 +246,30 @@ extern void add_setshow_boolean_cmd (cha struct cmd_list_element **set_list, struct cmd_list_element **show_list); +extern void add_setshow_filename_cmd (char *name, + enum command_class class, + char **var, + const char *set_doc, + const char *show_doc, + const char *help_doc, + const char *print, + cmd_sfunc_ftype *set_func, + cmd_sfunc_ftype *show_func, + struct cmd_list_element **set_list, + struct cmd_list_element **show_list); + +extern void add_setshow_string_cmd (char *name, + enum command_class class, + char **var, + const char *set_doc, + const char *show_doc, + const char *help_doc, + const char *print, + cmd_sfunc_ftype *set_func, + cmd_sfunc_ftype *show_func, + struct cmd_list_element **set_list, + struct cmd_list_element **show_list); + extern void add_setshow_uinteger_cmd (char *name, enum command_class class, unsigned int *var, Index: complaints.c =================================================================== RCS file: /cvs/src/src/gdb/complaints.c,v retrieving revision 1.15 diff -p -u -r1.15 complaints.c --- complaints.c 28 Jul 2004 17:26:26 -0000 1.15 +++ complaints.c 28 Jul 2004 19:29:41 -0000 @@ -311,13 +311,12 @@ clear_complaints (struct complaints **c, void _initialize_complaints (void) { - add_setshow_cmd ("complaints", class_support, var_zinteger, - &stop_whining, "\ + add_setshow_zinteger_cmd ("complaints", class_support, &stop_whining, "\ Set max number of complaints about incorrect symbols.", "\ Show max number of complaints about incorrect symbols.", "\ Set to zero to disable incorrect symbol complaints.", "\ Max number of complaints about incorrect symbols is %s.", - NULL, NULL, - &setlist, &showlist); + NULL, NULL, + &setlist, &showlist); } Index: m32r-rom.c =================================================================== RCS file: /cvs/src/src/gdb/m32r-rom.c,v retrieving revision 1.16 diff -p -u -r1.16 m32r-rom.c --- m32r-rom.c 28 Jul 2004 17:26:27 -0000 1.16 +++ m32r-rom.c 28 Jul 2004 19:29:41 -0000 @@ -558,24 +558,21 @@ Specify the serial device it is connecte mon2000_ops.to_open = mon2000_open; add_target (&mon2000_ops); - add_setshow_cmd ("download-path", class_obscure, - var_string, &download_path, "\ + add_setshow_string_cmd ("download-path", class_obscure, &download_path, "\ Set the default path for downloadable SREC files.", "\ Show the default path for downloadable SREC files.", "\ Determines the default path for downloadable SREC files.", "\ The default path for downloadable SREC files is %s.", NULL, NULL, &setlist, &showlist); - add_setshow_cmd ("board-address", class_obscure, - var_string, &board_addr, "\ + add_setshow_string_cmd ("board-address", class_obscure, &board_addr, "\ Set IP address for M32R-EVA target board.", "\ Show IP address for M32R-EVA target board.", "\ Determine the IP address for M32R-EVA target board.", "\ IP address for M32R-EVA target board is %s", NULL, NULL, &setlist, &showlist); - add_setshow_cmd ("server-address", class_obscure, - var_string, &server_addr, "\ + add_setshow_string_cmd ("server-address", class_obscure, &server_addr, "\ Set IP address for download server (GDB's host computer).", "\ Show IP address for download server (GDB's host computer).", "\ Determine the IP address for download server (GDB's host computer).", "\ Index: mips-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/mips-tdep.c,v retrieving revision 1.305 diff -p -u -r1.305 mips-tdep.c --- mips-tdep.c 28 Jul 2004 17:26:27 -0000 1.305 +++ mips-tdep.c 28 Jul 2004 19:29:41 -0000 @@ -6195,8 +6195,8 @@ Zerroing of upper 32 bits of 64-bit addr /* Allow the user to control the size of 32 bit registers within the raw remote packet. */ - add_setshow_cmd ("remote-mips64-transfers-32bit-regs", class_obscure, - var_boolean, &mips64_transfers_32bit_regs_p, "\ + add_setshow_boolean_cmd ("remote-mips64-transfers-32bit-regs", class_obscure, + &mips64_transfers_32bit_regs_p, "\ Set compatibility with 64-bit MIPS target that transfers 32-bit quantities.", "\ Show compatibility with 64-bit MIPS target that transfers 32-bit quantities.", "\ Use \"on\" to enable backward compatibility with older MIPS 64 GDB+target\n\ Index: nto-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/nto-tdep.c,v retrieving revision 1.7 diff -p -u -r1.7 nto-tdep.c --- nto-tdep.c 21 Apr 2004 17:47:10 -0000 1.7 +++ nto-tdep.c 28 Jul 2004 19:29:41 -0000 @@ -1,6 +1,6 @@ /* nto-tdep.c - general QNX Neutrino target functionality. - Copyright 2003 Free Software Foundation, Inc. + Copyright 2003, 2004 Free Software Foundation, Inc. Contributed by QNX Software Systems Ltd. @@ -306,12 +306,15 @@ static struct core_fns regset_core_fns = void _initialize_nto_tdep (void) { - add_setshow_cmd ("nto-debug", class_maintenance, var_zinteger, - &nto_internal_debugging, "Set QNX NTO internal debugging.\n\ + add_setshow_zinteger_cmd ("nto-debug", class_maintenance, + &nto_internal_debugging, "\ +Set QNX NTO internal debugging.", "\ +Show QNX NTO internal debugging.", "\ When non-zero, nto specific debug info is\n\ displayed. Different information is displayed\n\ -for different positive values.", "Show QNX NTO internal debugging.\n", - NULL, NULL, &setdebuglist, &showdebuglist); +for different positive values.", "\ +QNX NTO internal debugging is %s.", + NULL, NULL, &setdebuglist, &showdebuglist); /* We use SIG45 for pulses, or something, so nostop, noprint and pass them. */ Index: remote.c =================================================================== RCS file: /cvs/src/src/gdb/remote.c,v retrieving revision 1.142 diff -p -u -r1.142 remote.c --- remote.c 28 Jul 2004 17:26:27 -0000 1.142 +++ remote.c 28 Jul 2004 19:29:42 -0000 @@ -5469,20 +5469,22 @@ Whether to send break if interrupted is "Show the maximum number of bytes per memory-read packet.\n", &remote_show_cmdlist); - add_setshow_cmd ("hardware-watchpoint-limit", no_class, - var_zinteger, &remote_hw_watchpoint_limit, "\ + add_setshow_zinteger_cmd ("hardware-watchpoint-limit", no_class, + &remote_hw_watchpoint_limit, "\ Set the maximum number of target hardware watchpoints.", "\ Show the maximum number of target hardware watchpoints.", "\ Specify a negative limit for unlimited.", "\ The maximum number of target hardware watchpoints is %s.", - NULL, NULL, &remote_set_cmdlist, &remote_show_cmdlist); - add_setshow_cmd ("hardware-breakpoint-limit", no_class, - var_zinteger, &remote_hw_breakpoint_limit, "\ + NULL, NULL, + &remote_set_cmdlist, &remote_show_cmdlist); + add_setshow_zinteger_cmd ("hardware-breakpoint-limit", no_class, + &remote_hw_breakpoint_limit, "\ Set the maximum number of target hardware breakpoints.", "\ Show the maximum number of target hardware breakpoints.", "\ Specify a negative limit for unlimited.", "\ The maximum number of target hardware breakpoints is %s.", - NULL, NULL, &remote_set_cmdlist, &remote_show_cmdlist); + NULL, NULL, + &remote_set_cmdlist, &remote_show_cmdlist); deprecated_add_show_from_set (add_set_cmd ("remoteaddresssize", class_obscure, Index: cli/cli-decode.c =================================================================== RCS file: /cvs/src/src/gdb/cli/cli-decode.c,v retrieving revision 1.39 diff -p -u -r1.39 cli-decode.c --- cli/cli-decode.c 28 Jul 2004 17:26:27 -0000 1.39 +++ cli/cli-decode.c 28 Jul 2004 19:29:42 -0000 @@ -325,7 +325,7 @@ add_set_or_show_cmd (char *name, and SHOW_RESULT, if not NULL, are set to the resulting command structures. */ -void +static void add_setshow_cmd_full (char *name, enum command_class class, var_types var_type, void *var, @@ -357,28 +357,6 @@ add_setshow_cmd_full (char *name, *show_result = show; } -/* Add element named NAME to both the command SET_LIST and SHOW_LIST. - CLASS is as in add_cmd. VAR_TYPE is the kind of thing we are - setting. VAR is address of the variable being controlled by this - command. SET_FUNC and SHOW_FUNC are the callback functions (if - non-NULL). SET_DOC and SHOW_DOC are the documentation strings. */ - -void -add_setshow_cmd (char *name, - enum command_class class, - var_types var_type, void *var, - const char *set_doc, const char *show_doc, - const char *help_doc, const char *print, - 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_type, var, - set_doc, show_doc, help_doc, print, - set_func, show_func, set_list, show_list, - NULL, NULL); -} - struct cmd_list_element * add_set_cmd (char *name, enum command_class class, @@ -462,6 +440,44 @@ add_setshow_boolean_cmd (char *name, enu } /* Add element named NAME to both the set and show command LISTs (the + list for set/show or some sublist thereof). */ +void +add_setshow_filename_cmd (char *name, enum command_class class, + char **var, + const char *set_doc, const char *show_doc, + const char *help_doc, const char *print, + 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_filename, var, + set_doc, show_doc, help_doc, print, + set_func, show_func, + set_list, show_list, + NULL, NULL); +} + +/* Add element named NAME to both the set and show command LISTs (the + list for set/show or some sublist thereof). */ +void +add_setshow_string_cmd (char *name, enum command_class class, + char **var, + const char *set_doc, const char *show_doc, + const char *help_doc, const char *print, + 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_string, var, + set_doc, show_doc, help_doc, print, + set_func, show_func, + set_list, show_list, + 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_DOC are the documentation strings. */ Index: cli/cli-logging.c =================================================================== RCS file: /cvs/src/src/gdb/cli/cli-logging.c,v retrieving revision 1.3 diff -p -u -r1.3 cli-logging.c --- cli/cli-logging.c 28 Jul 2004 17:26:27 -0000 1.3 +++ cli/cli-logging.c 28 Jul 2004 19:29:42 -0000 @@ -187,12 +187,13 @@ If redirect is off, output will go to bo If redirect is on, output will go only to the log file.", "\ The logging output mode is %s.", NULL, NULL, &set_logging_cmdlist, &show_logging_cmdlist); - add_setshow_cmd ("file", class_support, var_filename, &logging_filename, "\ + add_setshow_filename_cmd ("file", class_support, &logging_filename, "\ Set the current logfile.", "\ Show the current logfile.", "\ The logfile is used when directing GDB's output.", "\ The current logfile is %s.", - NULL, NULL, &set_logging_cmdlist, &show_logging_cmdlist); + NULL, NULL, + &set_logging_cmdlist, &show_logging_cmdlist); add_cmd ("on", class_support, set_logging_on, "Enable logging.", &set_logging_cmdlist); add_cmd ("off", class_support, set_logging_off, --------------030003060504010607040308--