This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[commit] Make add_setshow's print work


Hello,

The attached implements the missing printing mechanims needed for i18n printing of set|show variables.

The existing code uses:

          /* Print doc minus "show" at start.  */
          print_doc_line (gdb_stdout, c->doc + 5);

          ui_out_text (uiout, " is ");
          ui_out_wrap_hint (uiout, "    ");
          if (quote)
            ui_out_text (uiout, "\"");
          ui_out_field_stream (uiout, "value", stb);
          if (quote)
            ui_out_text (uiout, "\"");
          ui_out_text (uiout, ".\n");
          do_cleanups (old_chain);

(note the "+ 5"). Knowing this I added:

const char *print

(e.x., "The value of foo is %s.") to the tentative inteface. There's a problem though, the print statement:

fprintf_unfiltered (print, value);

attracts the wrath of gcc (A -Wformat error). Consequently, in finishing this I've replaced "print" string with a proper function:

fprint_setshow_ftype *fprint_setshow

(void fprint_setshow (cmd_list_element *, ui_file *, const char *))

For the moment I've implemented only one such function - fprint_setshow_complaints. For the others I've commented things out.

commited,
Andrew
2005-02-10  Andrew Cagney  <cagney@gnu.org>

	* cli/cli-decode.c (add_setshow_enum_cmd, add_setshow_cmd_full)
	(add_setshow_auto_boolean_cmd, add_setshow_boolean_cmd)
	(add_setshow_filename_cmd, add_setshow_string_cmd)
	(add_setshow_uinteger_cmd, add_setshow_zinteger_cmd): Replace
	print string parameter with fprint_setshow function.
	* command.h (fprint_setshow_ftype): Define.  Update declarations.
	* cli/cli-setshow.c (do_setshow_command): When fprint_setshow is
	available, use that.
	* cli/cli-decode.h (struct cmd_list_element): Add field
	fprint_setshow.
	* complaints.c (fprint_setshow_complaints): New function.
	(_initialize_complaints): Pass to add_setshow_zinteger_cmd.
	* hppa-tdep.c (_initialize_hppa_tdep): Replace "print" parameter
	with NULL.
	* mips-tdep.c (_initialize_mips_tdep): Ditto.
	* m32r-rom.c (_initialize_m32r_rom): Ditto.
	* cris-tdep.c (_initialize_cris_tdep): Ditto.
	* arm-tdep.c (_initialize_arm_tdep): Ditto.
	* remote-rdi.c (_initialize_remote_rdi): Ditto.
	* alpha-tdep.c (_initialize_alpha_tdep): Ditto.
	* dwarf2read.c (_initialize_dwarf2_read): Ditto.
	* frame.c (_initialize_frame): Ditto.
	* target.c (initialize_targets): Ditto.
	* maint.c (_initialize_maint_cmds): Ditto.
	* observer.c (_initialize_observer): Ditto.
	* infcall.c (_initialize_infcall): Ditto.
	* breakpoint.c (_initialize_breakpoint): Ditto.
	* cli/cli-logging.c (_initialize_cli_logging): Ditto.
	* remote.c (add_packet_config_cmd, _initialize_remote): Ditto.

Index: alpha-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/alpha-tdep.c,v
retrieving revision 1.145
diff -p -u -r1.145 alpha-tdep.c
--- alpha-tdep.c	7 Feb 2005 00:09:52 -0000	1.145
+++ alpha-tdep.c	10 Feb 2005 17:31:29 -0000
@@ -1595,8 +1595,7 @@ Show the distance searched for the start
 If you are debugging a stripped executable, GDB needs to search through the\n\
 program for the start of a function.  This command sets the distance of the\n\
 search.  The only need to set it is when debugging a stripped executable."),
-			    _("\
-The distance searched for the start of a function is \"%d\"."),
+			    NULL, /* PRINT: The distance searched for the start of a function is \"%d\".  */
 			    reinit_frame_cache_sfunc, NULL,
 			    &setlist, &showlist);
 }
Index: arm-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/arm-tdep.c,v
retrieving revision 1.188
diff -p -u -r1.188 arm-tdep.c
--- arm-tdep.c	9 Feb 2005 23:14:58 -0000	1.188
+++ arm-tdep.c	10 Feb 2005 17:31:30 -0000
@@ -2884,7 +2884,7 @@ _initialize_arm_tdep (void)
 		       _("Set the disassembly style."),
 		       _("Show the disassembly style."),
 		       helptext,
-		       _("The disassembly style is \"%s\"."),
+		       NULL, /* PRINT: The disassembly style is \"%s\".  */
 		       set_disassembly_style_sfunc, NULL,
 		       &setarmcmdlist, &showarmcmdlist);
 
@@ -2892,7 +2892,7 @@ _initialize_arm_tdep (void)
 			   _("Set usage of ARM 32-bit mode."),
 			   _("Show usage of ARM 32-bit mode."),
 			   _("When off, a 26-bit PC will be used."),
-			   _("Usage of ARM 32-bit mode is %s."),
+			   NULL, /* PRINT: "Usage of ARM 32-bit mode is %s.  */
 			   NULL, NULL,
 			   &setarmcmdlist, &showarmcmdlist);
 
@@ -2905,7 +2905,7 @@ softfpa - Software FP, mixed-endian doub
 fpa - FPA co-processor (GCC compiled).\n\
 softvfp - Software FP with pure-endian doubles.\n\
 vfp - VFP co-processor."),
-			_("The floating point type is \"%s\"."),
+			NULL, /* PRINT: "The floating point type is \"%s\".  */
 			set_fp_model_sfunc, show_fp_model,
 			&setarmcmdlist, &showarmcmdlist);
 
@@ -2914,7 +2914,7 @@ vfp - VFP co-processor."),
 			   _("Set ARM debugging."),
 			   _("Show ARM debugging."),
 			   _("When on, arm-specific debugging is enabled."),
-			   _("ARM debugging is %s."),
+			   NULL, /* PRINT: "ARM debugging is %s.  */
 			   NULL, NULL,
 			   &setdebuglist, &showdebuglist);
 }
Index: breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.c,v
retrieving revision 1.201
diff -p -u -r1.201 breakpoint.c
--- breakpoint.c	8 Feb 2005 04:15:39 -0000	1.201
+++ breakpoint.c	10 Feb 2005 17:31:30 -0000
@@ -7955,8 +7955,8 @@ Show debugger's behavior regarding pendi
 If on, an unrecognized breakpoint location will cause gdb to create a\n\
 pending breakpoint.  If off, an unrecognized breakpoint location results in\n\
 an error.  If auto, an unrecognized breakpoint location results in a\n\
-user-query to see if a pending breakpoint should be created.", "\
-Debugger's behavior regarding pending breakpoints is %s.",
+user-query to see if a pending breakpoint should be created.",
+				NULL, /*  PRINT: Debugger's behavior regarding pending breakpoints is %s.  */
 				NULL, NULL,
 				&breakpoint_set_cmdlist,
 				&breakpoint_show_cmdlist);
Index: command.h
===================================================================
RCS file: /cvs/src/src/gdb/command.h,v
retrieving revision 1.44
diff -p -u -r1.44 command.h
--- command.h	9 Feb 2005 23:14:59 -0000	1.44
+++ command.h	10 Feb 2005 17:31:30 -0000
@@ -223,6 +223,13 @@ extern struct cmd_list_element *add_set_
 						  const char **var,
 						  char *doc,
 						  struct cmd_list_element **list);
+
+/* Print the set|show CMD's variable's VALUE on FILE.  Do not include
+   a trailing "\n".  */
+typedef void (fprint_setshow_ftype) (struct cmd_list_element *cmd,
+				     struct ui_file *file,
+				     const char *value);
+
 extern void add_setshow_enum_cmd (char *name,
 				  enum command_class class,
 				  const char *enumlist[],
@@ -230,7 +237,7 @@ extern void add_setshow_enum_cmd (char *
 				  const char *set_doc,
 				  const char *show_doc,
 				  const char *help_doc,
-				  const char *print,
+				  fprint_setshow_ftype *fprint_setshow,
 				  cmd_sfunc_ftype *set_func,
 				  cmd_sfunc_ftype *show_func,
 				  struct cmd_list_element **set_list,
@@ -242,7 +249,7 @@ extern void add_setshow_auto_boolean_cmd
 					  const char *set_doc,
 					  const char *show_doc,
 					  const char *help_doc,
-					  const char *print,
+					  fprint_setshow_ftype *fprint_setshow,
 					  cmd_sfunc_ftype *set_func,
 					  cmd_sfunc_ftype *show_func,
 					  struct cmd_list_element **set_list,
@@ -252,7 +259,7 @@ extern void add_setshow_boolean_cmd (cha
 				     enum command_class class,
 				     int *var,
 				     const char *set_doc, const char *show_doc,
-				     const char *help_doc, const char *print,
+				     const char *help_doc, fprint_setshow_ftype *fprint_setshow,
 				     cmd_sfunc_ftype *set_func,
 				     cmd_sfunc_ftype *show_func,
 				     struct cmd_list_element **set_list,
@@ -264,7 +271,7 @@ extern void add_setshow_filename_cmd (ch
 				      const char *set_doc,
 				      const char *show_doc,
 				      const char *help_doc,
-				      const char *print,
+				      fprint_setshow_ftype *fprint_setshow,
 				      cmd_sfunc_ftype *set_func,
 				      cmd_sfunc_ftype *show_func,
 				      struct cmd_list_element **set_list,
@@ -276,7 +283,7 @@ extern void add_setshow_string_cmd (char
 				    const char *set_doc,
 				    const char *show_doc,
 				    const char *help_doc,
-				    const char *print,
+				    fprint_setshow_ftype *fprint_setshow,
 				    cmd_sfunc_ftype *set_func,
 				    cmd_sfunc_ftype *show_func,
 				    struct cmd_list_element **set_list,
@@ -288,7 +295,7 @@ extern void add_setshow_uinteger_cmd (ch
 				      const char *set_doc,
 				      const char *show_doc,
 				      const char *help_doc,
-				      const char *print,
+				      fprint_setshow_ftype *fprint_setshow,
 				      cmd_sfunc_ftype *set_func,
 				      cmd_sfunc_ftype *show_func,
 				      struct cmd_list_element **set_list,
@@ -300,7 +307,7 @@ extern void add_setshow_zinteger_cmd (ch
 				      const char *set_doc,
 				      const char *show_doc,
 				      const char *help_doc,
-				      const char *print,
+				      fprint_setshow_ftype *fprint_setshow,
 				      cmd_sfunc_ftype *set_func,
 				      cmd_sfunc_ftype *show_func,
 				      struct cmd_list_element **set_list,
Index: complaints.c
===================================================================
RCS file: /cvs/src/src/gdb/complaints.c,v
retrieving revision 1.18
diff -p -u -r1.18 complaints.c
--- complaints.c	29 Jan 2005 17:53:26 -0000	1.18
+++ complaints.c	10 Feb 2005 17:31:30 -0000
@@ -309,13 +309,23 @@ clear_complaints (struct complaints **c,
     complaints->series = SHORT_FIRST_MESSAGE;
 }
 
+static void
+fprint_setshow_complaints (struct cmd_list_element *cmd,
+			   struct ui_file *file,
+			   const char *value)
+{
+  fprintf_filtered (file, _("Max number of complaints about incorrect"
+			    " symbols is %s."),
+		    value);
+}
+
 void
 _initialize_complaints (void)
 {
   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."), NULL, _("\
-Max number of complaints about incorrect symbols is %s."),
+Show max number of complaints about incorrect symbols."), NULL,
+			    fprint_setshow_complaints,
 			    NULL, NULL,
 			    &setlist, &showlist);
 
Index: cris-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/cris-tdep.c,v
retrieving revision 1.122
diff -p -u -r1.122 cris-tdep.c
--- cris-tdep.c	7 Feb 2005 00:09:53 -0000	1.122
+++ cris-tdep.c	10 Feb 2005 17:31:31 -0000
@@ -3919,7 +3919,7 @@ _initialize_cris_tdep (void)
 			    "Set the current CRIS version.",
 			    "Show the current CRIS version.",
 			    "Set if autodetection fails.",
-			    "Current CRIS version is %s.",
+			    NULL, /* PRINT: Current CRIS version is %s.  */
 			    set_cris_version, NULL,
 			    &setlist, &showlist);
   
@@ -3928,7 +3928,7 @@ _initialize_cris_tdep (void)
 			   "Set the usage of Dwarf-2 CFI for CRIS.",
 			   "Show the usage of Dwarf-2 CFI for CRIS.",
 			   "Set to \"off\" if using gcc-cris < R59.",
-			   "Usage of Dwarf-2 CFI for CRIS is %d.",
+			   NULL, /* PRINT: Usage of Dwarf-2 CFI for CRIS is %d.  */
 			   set_cris_dwarf2_cfi, NULL,
 			   &setlist, &showlist);
 
Index: dwarf2read.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2read.c,v
retrieving revision 1.169
diff -p -u -r1.169 dwarf2read.c
--- dwarf2read.c	10 Nov 2004 20:40:33 -0000	1.169
+++ dwarf2read.c	10 Feb 2005 17:31:31 -0000
@@ -9652,8 +9652,7 @@ _initialize_dwarf2_read (void)
 			    "in memory longer, and more total memory will "
 			    "be used.  Zero disables\n"
 			    "caching, which can slow down startup.",
-			    "The upper bound on the age of cached "
-			    "dwarf2 compilation units is %d.",
+			    NULL, /* PRINT: The upper bound on the age of cached dwarf2 compilation units is %d.  */
 			    NULL, NULL, &set_dwarf2_cmdlist,
 			    &show_dwarf2_cmdlist);
 }
Index: frame.c
===================================================================
RCS file: /cvs/src/src/gdb/frame.c,v
retrieving revision 1.199
diff -p -u -r1.199 frame.c
--- frame.c	14 Jan 2005 23:27:13 -0000	1.199
+++ frame.c	10 Feb 2005 17:31:32 -0000
@@ -1555,8 +1555,8 @@ Set whether backtraces should continue p
 Show whether backtraces should continue past \"main\".", "\
 Normally the caller of \"main\" is not of interest, so GDB will terminate\n\
 the backtrace at \"main\".  Set this variable if you need to see the rest\n\
-of the stack trace.", "\
-Whether backtraces should continue past \"main\" is %s.",
+of the stack trace.",
+			   NULL, /* PRINT: Whether backtraces should continue past \"main\" is %s.  */
 			   NULL, NULL, &set_backtrace_cmdlist,
 			   &show_backtrace_cmdlist);
 
@@ -1566,8 +1566,8 @@ Set whether backtraces should continue p
 Show whether backtraces should continue past the entry point of a program.", "\
 Normally there are no callers beyond the entry point of a program, so GDB\n\
 will terminate the backtrace there.  Set this variable if you need to see \n\
-the rest of the stack trace.", "\
-Whether backtraces should continue past the entry point is %s.",
+the rest of the stack trace.",
+			   NULL, /* PRINT: Whether backtraces should continue past the entry point is %s.  */
 			   NULL, NULL, &set_backtrace_cmdlist,
 			   &show_backtrace_cmdlist);
 
@@ -1576,8 +1576,8 @@ Whether backtraces should continue past 
 Set an upper bound on the number of backtrace levels.", "\
 Show the upper bound on the number of backtrace levels.", "\
 No more than the specified number of frames can be displayed or examined.\n\
-Zero is unlimited.", "\
-An upper bound on the number of backtrace levels is %s.",
+Zero is unlimited.",
+			    NULL, /* PRINT: An upper bound on the number of backtrace levels is %s.  */
 			    NULL, NULL, &set_backtrace_cmdlist,
 			    &show_backtrace_cmdlist);
 
Index: hppa-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/hppa-tdep.c,v
retrieving revision 1.200
diff -p -u -r1.200 hppa-tdep.c
--- hppa-tdep.c	7 Feb 2005 00:09:53 -0000	1.200
+++ hppa-tdep.c	10 Feb 2005 17:31:32 -0000
@@ -2877,6 +2877,7 @@ Set whether hppa target specific debuggi
 Show whether hppa target specific debugging information is displayed.", "\
 This flag controls whether hppa target specific debugging information is\n\
 displayed.  This information is particularly useful for debugging frame\n\
-unwinding problems.", "hppa debug flag is %s.",
+unwinding problems.",
+			   NULL, /* PRINT hppa debug flag is %s.  */
 			   NULL, NULL, &setdebuglist, &showdebuglist);
 }
Index: infcall.c
===================================================================
RCS file: /cvs/src/src/gdb/infcall.c,v
retrieving revision 1.65
diff -p -u -r1.65 infcall.c
--- infcall.c	8 Feb 2005 04:15:39 -0000	1.65
+++ infcall.c	10 Feb 2005 17:31:32 -0000
@@ -885,8 +885,8 @@ function.  However, some older debug inf
 information to determine that a function is prototyped.  If this flag is\n\
 set, GDB will perform the conversion for a function it considers\n\
 unprototyped.\n\
-The default is to perform the conversion.\n", "\
-Coercion of floats to doubles when calling functions is %s.",
+The default is to perform the conversion.\n",
+			   NULL, /* PRINT: Coercion of floats to doubles when calling functions is %s.  */
 			   NULL, NULL, &setlist, &showlist);
 
   add_setshow_boolean_cmd ("unwindonsignal", no_class,
@@ -896,7 +896,7 @@ Show unwinding of stack if a signal is r
 The unwindonsignal lets the user determine what gdb should do if a signal\n\
 is received while in a function called from gdb (call dummy).  If set, gdb\n\
 unwinds the stack and restore the context to what as it was before the call.\n\
-The default is to stop in the frame where the signal was received.", "\
-Unwinding of stack if a signal is received while in a call dummy is %s.",
+The default is to stop in the frame where the signal was received.",
+			   NULL, /* PRINT: Unwinding of stack if a signal is received while in a call dummy is %s.  */
 			   NULL, NULL, &setlist, &showlist);
 }
Index: m32r-rom.c
===================================================================
RCS file: /cvs/src/src/gdb/m32r-rom.c,v
retrieving revision 1.18
diff -p -u -r1.18 m32r-rom.c
--- m32r-rom.c	12 Jan 2005 18:31:32 -0000	1.18
+++ m32r-rom.c	10 Feb 2005 17:31:32 -0000
@@ -562,22 +562,22 @@ Specify the serial device it is connecte
   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.",
+Determines the default path for downloadable SREC files.",
+			  NULL, /* PRINT: The default path for downloadable SREC files is %s.  */
 		   NULL, NULL, &setlist, &showlist);
 
   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",
+Determine the IP address for M32R-EVA target board.",
+			  NULL, /* PRINT: IP address for M32R-EVA target board is %s.  */
 		   NULL, NULL, &setlist, &showlist);
 
   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).", "\
-IP address for download server (GDB's host computer) is %s.",
+Determine the IP address for download server (GDB's host computer).",
+			  NULL, /* PRINT: IP address for download server (GDB's host computer) is %s.  */
 		   NULL, NULL, &setlist, &showlist);
 
   add_com ("upload", class_obscure, m32r_upload_command,
Index: maint.c
===================================================================
RCS file: /cvs/src/src/gdb/maint.c,v
retrieving revision 1.45
diff -p -u -r1.45 maint.c
--- maint.c	20 Sep 2004 22:26:20 -0000	1.45
+++ maint.c	10 Feb 2005 17:31:32 -0000
@@ -863,8 +863,8 @@ of time passes without a response from t
 			   &maintenance_profile_p, "\
 Set internal profiling.", "\
 Show internal profiling.", "\
-When enabled GDB is profiled.", "\
-Internal profiling is %s.",
+When enabled GDB is profiled.",
+			   NULL, /* PRINT: Internal profiling is %s.  */
 			   maintenance_set_profile_cmd, NULL,
 			   &maintenance_set_cmdlist,
 			   &maintenance_show_cmdlist);
Index: mips-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/mips-tdep.c,v
retrieving revision 1.368
diff -p -u -r1.368 mips-tdep.c
--- mips-tdep.c	9 Feb 2005 23:14:59 -0000	1.368
+++ mips-tdep.c	10 Feb 2005 17:31:32 -0000
@@ -5187,8 +5187,8 @@ This option can be set to one of:\n\
   64    - Force GDB to treat saved GP registers as 64-bit\n\
   auto  - Allow GDB to use the target's default setting or autodetect the\n\
           saved GP register size from information contained in the executable.\n\
-          (default: auto)", "\
-Size of general purpose registers saved on the stack is %s.\n",
+          (default: auto)",
+			NULL, /* PRINT: Size of general purpose registers saved on the stack is %s.  */
 			NULL, NULL, &setmipscmdlist, &showmipscmdlist);
 
   /* Allow the user to override the argument stack size. */
@@ -5200,8 +5200,8 @@ This option can be set to one of:\n\
   32    - Force GDB to allocate 32-bit chunks per argument\n\
   64    - Force GDB to allocate 64-bit chunks per argument\n\
   auto  - Allow GDB to determine the correct setting from the current\n\
-          target and executable (default)", "\
-The amount of stack space reserved for each argument is %s.\n",
+          target and executable (default)",
+			NULL, /* PRINT: The amount of stack space reserved for each argument is %s.  */
 			NULL, NULL, &setmipscmdlist, &showmipscmdlist);
 
   /* Allow the user to override the ABI. */
@@ -5252,8 +5252,8 @@ Set the distance searched for the start 
 Show the distance searched for the start of a function.\n", "\
 If you are debugging a stripped executable, GDB needs to search through the\n\
 program for the start of a function.  This command sets the distance of the\n\
-search.  The only need to set it is when debugging a stripped executable.", "\
-The distance searched for the start of a function is %s.\n",
+search.  The only need to set it is when debugging a stripped executable.",
+			    NULL, /* PRINT: The distance searched for the start of a function is %s.  */
 			    reinit_frame_cache_sfunc, NULL,
 			    &setlist, &showlist);
 
@@ -5263,8 +5263,8 @@ The distance searched for the start of a
 Set zeroing of upper 32 bits of 64-bit addresses.", "\
 Show zeroing of upper 32 bits of 64-bit addresses.", "\
 Use \"on\" to enable the masking, \"off\" to disable it and \"auto\" to \n\
-allow GDB to determine the correct value.\n", "\
-Zerroing of upper 32 bits of 64-bit address is %s.",
+allow GDB to determine the correct value.\n",
+				NULL, /* PRINT: Zerroing of upper 32 bits of 64-bit address is %s.  */
 				NULL, show_mask_address, &setmipscmdlist, &showmipscmdlist);
 
   /* Allow the user to control the size of 32 bit registers within the
@@ -5275,8 +5275,8 @@ Set compatibility with 64-bit MIPS targe
 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\
 that would transfer 32 bits for some registers (e.g. SR, FSR) and\n\
-64 bits for others.  Use \"off\" to disable compatibility mode", "\
-Compatibility with 64-bit MIPS target that transfers 32-bit quantities is %s.",
+64 bits for others.  Use \"off\" to disable compatibility mode",
+			   NULL, /* PRINT: Compatibility with 64-bit MIPS target that transfers 32-bit quantities is %s.  */
  set_mips64_transfers_32bit_regs, NULL, &setlist, &showlist);
 
   /* Debug this files internals. */
@@ -5284,8 +5284,8 @@ Compatibility with 64-bit MIPS target th
 			    &mips_debug, "\
 Set mips debugging.\n", "\
 Show mips debugging.\n", "\
-When non-zero, mips specific debugging is enabled.\n", "\
-Mips debugging is currently %s.\n",
+When non-zero, mips specific debugging is enabled.\n",
+			    NULL, /* PRINT: Mips debugging is currently %s.  */
 			    NULL, NULL,
 			    &setdebuglist, &showdebuglist);
 }
Index: observer.c
===================================================================
RCS file: /cvs/src/src/gdb/observer.c,v
retrieving revision 1.8
diff -p -u -r1.8 observer.c
--- observer.c	28 Jul 2004 17:26:27 -0000	1.8
+++ observer.c	10 Feb 2005 17:31:32 -0000
@@ -202,8 +202,8 @@ _initialize_observer (void)
   add_setshow_zinteger_cmd ("observer", class_maintenance, &observer_debug, "\
 Set observer debugging.", "\
 Show observer debugging.", "\
-When non-zero, observer debugging is enabled.", "\
-Observer debugging is %s.",
+When non-zero, observer debugging is enabled.",
+			    NULL, /* PRINT: Observer debugging is %s.  */
 			    NULL, NULL,
 			    &setdebuglist, &showdebuglist);
 }
Index: remote-rdi.c
===================================================================
RCS file: /cvs/src/src/gdb/remote-rdi.c,v
retrieving revision 1.36
diff -p -u -r1.36 remote-rdi.c
--- remote-rdi.c	8 Oct 2004 20:29:54 -0000	1.36
+++ remote-rdi.c	10 Feb 2005 17:31:32 -0000
@@ -995,8 +995,8 @@ _initialize_remote_rdi (void)
 Set target has ROM at addr 0.", "\
 Show if target has ROM at addr 0.", "\
 A true value disables vector catching, false enables vector catching.\n\
-This is evaluated at the time the 'target rdi' command is executed.", "\
-Target has ROM at addr 0 is %s.",
+This is evaluated at the time the 'target rdi' command is executed.",
+			   NULL, /* PRINT: Target has ROM at addr 0 is %s.  */
 			   NULL, NULL,
 			   &setlist, &showlist);
 
@@ -1005,8 +1005,8 @@ Set enable for ADP heartbeat packets.", 
 Show enable for ADP heartbeat packets.", "\
 I don't know why you would want this. If you enable them,\n\
 it will confuse ARM and EPI JTAG interface boxes as well\n\
-as the Angel Monitor.", "\
-Enable for ADP heartbeat packets is %s.",
+as the Angel Monitor.",
+			   NULL, /* PRINT: Enable for ADP heartbeat packets is %s.  */
 			   NULL, NULL,
 			   &setlist, &showlist);
 }
Index: remote.c
===================================================================
RCS file: /cvs/src/src/gdb/remote.c,v
retrieving revision 1.163
diff -p -u -r1.163 remote.c
--- remote.c	19 Jan 2005 21:15:44 -0000	1.163
+++ remote.c	10 Feb 2005 17:31:32 -0000
@@ -660,7 +660,7 @@ add_packet_config_cmd (struct packet_con
   cmd_name = xstrprintf ("%s-packet", title);
   add_setshow_auto_boolean_cmd (cmd_name, class_obscure,
 				&config->detect, set_doc, show_doc,
-				"", print,
+				"", NULL /*print*/,
 				set_func, show_func,
 				set_remote_list, show_remote_list);
   /* set/show remote NAME-packet {auto,on,off} -- legacy.  */
@@ -5600,8 +5600,8 @@ terminating `#' character and checksum."
   add_setshow_boolean_cmd ("remotebreak", no_class, &remote_break, "\
 Set whether to send break if interrupted.", "\
 Show whether to send break if interrupted.", "\
-If set, a break, instead of a cntrl-c, is sent to the remote target.", "\
-Whether to send break if interrupted is %s.",
+If set, a break, instead of a cntrl-c, is sent to the remote target.",
+			   NULL, /* PRINT: Whether to send break if interrupted is %s.  */
 			   NULL, NULL,
 			   &setlist, &showlist);
 
@@ -5642,16 +5642,16 @@ Whether to send break if interrupted is 
 			    &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.",
+Specify a negative limit for unlimited.",
+			    NULL, /* PRINT: The maximum number of target hardware watchpoints is %s.  */
 			    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.",
+Specify a negative limit for unlimited.",
+			    NULL, /* PRINT: The maximum number of target hardware breakpoints is %s.  */
 			    NULL, NULL,
 			    &remote_set_cmdlist, &remote_show_cmdlist);
 
@@ -5755,8 +5755,8 @@ in a memory packet.\n",
 Set use of remote protocol `Z' packets", "\
 Show use of remote protocol `Z' packets ", "\
 When set, GDB will attempt to use the remote breakpoint and watchpoint\n\
-packets.", "\
-Use of remote protocol `Z' packets is %s",
+packets.",
+				NULL, /* PRINT: Use of remote protocol `Z' packets is %s.  */
 				set_remote_protocol_Z_packet_cmd,
 				show_remote_protocol_Z_packet_cmd,
 				&remote_set_cmdlist, &remote_show_cmdlist);
Index: target.c
===================================================================
RCS file: /cvs/src/src/gdb/target.c,v
retrieving revision 1.92
diff -p -u -r1.92 target.c
--- target.c	27 Jan 2005 20:09:10 -0000	1.92
+++ target.c	10 Feb 2005 17:31:33 -0000
@@ -2569,8 +2569,8 @@ Set mode for reading from readonly secti
 Show mode for reading from readonly sections.", "\
 When this mode is on, memory reads from readonly sections (such as .text)\n\
 will be read from the object file instead of from the target.  This will\n\
-result in significant performance improvement for remote targets.", "\
-Mode for reading from readonly sections is %s.",
+result in significant performance improvement for remote targets.",
+			   NULL, /* PRINT: Mode for reading from readonly sections is %s.  */
 			   NULL, NULL,
 			   &setlist, &showlist);
 
Index: cli/cli-decode.c
===================================================================
RCS file: /cvs/src/src/gdb/cli/cli-decode.c,v
retrieving revision 1.44
diff -p -u -r1.44 cli-decode.c
--- cli/cli-decode.c	9 Feb 2005 23:15:01 -0000	1.44
+++ cli/cli-decode.c	10 Feb 2005 17:31:33 -0000
@@ -330,7 +330,8 @@ 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,
+		      const char *help_doc,
+		      fprint_setshow_ftype *fprint_setshow,
 		      cmd_sfunc_ftype *set_func,
 		      cmd_sfunc_ftype *show_func,
 		      struct cmd_list_element **set_list,
@@ -359,6 +360,8 @@ add_setshow_cmd_full (char *name,
     set_cmd_sfunc (set, set_func);
   show = add_set_or_show_cmd (name, show_cmd, class, var_type, var,
 			      full_show_doc, show_list);
+  show->fprint_setshow = fprint_setshow;
+
   if (show_func != NULL)
     set_cmd_sfunc (show, show_func);
 
@@ -415,7 +418,7 @@ add_setshow_enum_cmd (char *name,
 		      const char *set_doc,
 		      const char *show_doc,
 		      const char *help_doc,
-		      const char *print,
+		      fprint_setshow_ftype *fprint_setshow,
 		      cmd_sfunc_ftype *set_func,
 		      cmd_sfunc_ftype *show_func,
 		      struct cmd_list_element **set_list,
@@ -423,7 +426,8 @@ add_setshow_enum_cmd (char *name,
 {
   struct cmd_list_element *c;
   add_setshow_cmd_full (name, class, var_enum, var,
-			set_doc, show_doc, help_doc, print,
+			set_doc, show_doc, help_doc,
+			fprint_setshow,
 			set_func, show_func,
 			set_list, show_list,
 			&c, NULL);
@@ -439,7 +443,8 @@ add_setshow_auto_boolean_cmd (char *name
 			      enum command_class class,
 			      enum auto_boolean *var,
 			      const char *set_doc, const char *show_doc,
-			      const char *help_doc, const char *print,
+			      const char *help_doc,
+			      fprint_setshow_ftype *fprint_setshow,
 			      cmd_sfunc_ftype *set_func,
 			      cmd_sfunc_ftype *show_func,
 			      struct cmd_list_element **set_list,
@@ -448,7 +453,7 @@ add_setshow_auto_boolean_cmd (char *name
   static const char *auto_boolean_enums[] = { "on", "off", "auto", NULL };
   struct cmd_list_element *c;
   add_setshow_cmd_full (name, class, var_auto_boolean, var,
-			set_doc, show_doc, help_doc, print,
+			set_doc, show_doc, help_doc, fprint_setshow,
 			set_func, show_func,
 			set_list, show_list,
 			&c, NULL);
@@ -462,7 +467,8 @@ add_setshow_auto_boolean_cmd (char *name
 void
 add_setshow_boolean_cmd (char *name, enum command_class class, int *var,
 			 const char *set_doc, const char *show_doc,
-			 const char *help_doc, const char *print,
+			 const char *help_doc,
+			 fprint_setshow_ftype *fprint_setshow,
 			 cmd_sfunc_ftype *set_func,
 			 cmd_sfunc_ftype *show_func,
 			 struct cmd_list_element **set_list,
@@ -471,7 +477,7 @@ add_setshow_boolean_cmd (char *name, enu
   static const char *boolean_enums[] = { "on", "off", NULL };
   struct cmd_list_element *c;
   add_setshow_cmd_full (name, class, var_boolean, var,
-			set_doc, show_doc, help_doc, print,
+			set_doc, show_doc, help_doc, fprint_setshow,
 			set_func, show_func,
 			set_list, show_list,
 			&c, NULL);
@@ -484,14 +490,15 @@ 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,
+			  const char *help_doc,
+			  fprint_setshow_ftype *fprint_setshow,
 			  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_doc, show_doc, help_doc, fprint_setshow,
 			set_func, show_func,
 			set_list, show_list,
 			NULL, NULL);
@@ -503,14 +510,15 @@ 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,
+			  const char *help_doc,
+			fprint_setshow_ftype *fprint_setshow,
 			  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_doc, show_doc, help_doc, fprint_setshow,
 			set_func, show_func,
 			set_list, show_list,
 			NULL, NULL);
@@ -524,14 +532,15 @@ void
 add_setshow_uinteger_cmd (char *name, enum command_class class,
 			  unsigned int *var,
 			  const char *set_doc, const char *show_doc,
-			  const char *help_doc, const char *print,
+			  const char *help_doc,
+			  fprint_setshow_ftype *fprint_setshow,
 			  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_uinteger, var,
-			set_doc, show_doc, help_doc, print,
+			set_doc, show_doc, help_doc, fprint_setshow,
 			set_func, show_func,
 			set_list, show_list,
 			NULL, NULL);
@@ -545,14 +554,15 @@ void
 add_setshow_zinteger_cmd (char *name, enum command_class class,
 			  int *var,
 			  const char *set_doc, const char *show_doc,
-			  const char *help_doc, const char *print,
+			  const char *help_doc,
+			  fprint_setshow_ftype *fprint_setshow,
 			  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, help_doc, print,
+			set_doc, show_doc, help_doc, fprint_setshow,
 			set_func, show_func,
 			set_list, show_list,
 			NULL, NULL);
Index: cli/cli-decode.h
===================================================================
RCS file: /cvs/src/src/gdb/cli/cli-decode.h,v
retrieving revision 1.19
diff -p -u -r1.19 cli-decode.h
--- cli/cli-decode.h	14 Jan 2005 04:41:36 -0000	1.19
+++ cli/cli-decode.h	10 Feb 2005 17:31:33 -0000
@@ -88,6 +88,10 @@ struct cmd_list_element
        Entire string should also end with a period, not a newline.  */
     char *doc;
 
+    /* For set/show commands.  A method for printing the output to the
+       specified stream.  */
+    fprint_setshow_ftype *fprint_setshow;
+
     /* flags : a bitfield 
        
        bit 0: (LSB) CMD_DEPRECATED, when 1 indicated that this command
Index: cli/cli-logging.c
===================================================================
RCS file: /cvs/src/src/gdb/cli/cli-logging.c,v
retrieving revision 1.4
diff -p -u -r1.4 cli-logging.c
--- cli/cli-logging.c	28 Jul 2004 19:42:01 -0000	1.4
+++ cli/cli-logging.c	10 Feb 2005 17:31:33 -0000
@@ -177,21 +177,21 @@ _initialize_cli_logging (void)
   add_setshow_boolean_cmd ("overwrite", class_support, &logging_overwrite, "\
 Set whether logging overwrites or appends to the log file.", "\
 Show whether logging overwrites or appends to the log file.", "\
-If set, logging overrides the log file.", "\
-Whether logging overwrites or appends to the log file is %s.",
+If set, logging overrides the log file.",
+			   NULL, /* PRINT: Whether logging overwrites or appends to the log file is %s.  */
 			   NULL, NULL, &set_logging_cmdlist, &show_logging_cmdlist);
   add_setshow_boolean_cmd ("redirect", class_support, &logging_redirect, "\
 Set the logging output mode.", "\
 Show the logging output mode.", "\
 If redirect is off, output will go to both the screen and the log file.\n\
-If redirect is on, output will go only to the log file.", "\
-The logging output mode is %s.",
+If redirect is on, output will go only to the log file.",
+			   NULL, /* PRINT: The logging output mode is %s.  */
 			   NULL, NULL, &set_logging_cmdlist, &show_logging_cmdlist);
   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.",
+The logfile is used when directing GDB's output.",
+			    NULL, /* PRINT: The current logfile is %s.  */
 			    NULL, NULL,
 			    &set_logging_cmdlist, &show_logging_cmdlist);
   add_cmd ("on", class_support, set_logging_on,
Index: cli/cli-setshow.c
===================================================================
RCS file: /cvs/src/src/gdb/cli/cli-setshow.c,v
retrieving revision 1.17
diff -p -u -r1.17 cli-setshow.c
--- cli/cli-setshow.c	10 Feb 2005 15:24:37 -0000	1.17
+++ cli/cli-setshow.c	10 Feb 2005 17:31:33 -0000
@@ -337,6 +337,14 @@ do_setshow_command (char *arg, int from_
 
       if (ui_out_is_mi_like_p (uiout))
 	ui_out_field_stream (uiout, "value", stb);
+      else if (c->fprint_setshow != NULL)
+	{
+	  long length;
+	  char *value = ui_file_xstrdup (stb->stream, &length);
+	  make_cleanup (xfree, value);
+	  c->fprint_setshow (c, gdb_stdout, value);
+	  fprintf_filtered (gdb_stdout, "\n");
+	}
       else
 	{
 	  /* Print doc minus "show" at start.  */

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]