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] New function add_setshow_string_noescape_cmd


... replacing some, but not all, references to var_string_noescape (more changes needed). Missed this when adding the other setshow functions.

committed,
Andrew
2005-02-16  Andrew Cagney  <cagney@gnu.org>

	* cli/cli-decode.c (add_setshow_string_noescape_cmd): New function.
	* command.h (add_setshow_string_noescape_cmd): Declare.
	* wince.c (_initialize_wince): Use.
	* symfile.c (_initialize_symfile): Use.
	(set_ext_lang_command): Update declaration.
	* corefile.c (_initialize_core): Use.

Index: command.h
===================================================================
RCS file: /cvs/src/src/gdb/command.h,v
retrieving revision 1.45
diff -p -u -r1.45 command.h
--- command.h	10 Feb 2005 17:32:47 -0000	1.45
+++ command.h	16 Feb 2005 14:13:00 -0000
@@ -289,6 +289,18 @@ extern void add_setshow_string_cmd (char
 				    struct cmd_list_element **set_list,
 				    struct cmd_list_element **show_list);
 
+extern void add_setshow_string_noescape_cmd (char *name,
+					     enum command_class class,
+					     char **var,
+					     const char *set_doc,
+					     const char *show_doc,
+					     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);
+
 extern void add_setshow_uinteger_cmd (char *name,
 				      enum command_class class,
 				      unsigned int *var,
Index: corefile.c
===================================================================
RCS file: /cvs/src/src/gdb/corefile.c,v
retrieving revision 1.32
diff -p -u -r1.32 corefile.c
--- corefile.c	14 Feb 2005 18:10:07 -0000	1.32
+++ corefile.c	16 Feb 2005 14:13:00 -0000
@@ -448,13 +448,15 @@ No arg means have no core file.  This co
 `target core' and `detach' commands."), &cmdlist);
   set_cmd_completer (c, filename_completer);
 
-  c = add_set_cmd ("gnutarget", class_files, var_string_noescape,
-		   (char *) &gnutarget_string,
-		   "Set the current BFD target.\n\
-Use `set gnutarget auto' to specify automatic detection.",
-		   &setlist);
-  set_cmd_sfunc (c, set_gnutarget_command);
-  deprecated_add_show_from_set (c, &showlist);
+  
+  add_setshow_string_noescape_cmd ("gnutarget", class_files,
+				   &gnutarget_string, _("(\
+Set the current BFD target."), _("\
+Show the current BFD target."), _("\
+Use `set gnutarget auto' to specify automatic detection."),
+				   NULL, /* FIXME: i18n: */
+				   set_gnutarget_command, NULL,	   
+				   &setlist, &showlist);
 
   if (getenv ("GNUTARGET"))
     set_gnutarget (getenv ("GNUTARGET"));
Index: symfile.c
===================================================================
RCS file: /cvs/src/src/gdb/symfile.c,v
retrieving revision 1.150
diff -p -u -r1.150 symfile.c
--- symfile.c	15 Feb 2005 15:49:20 -0000	1.150
+++ symfile.c	16 Feb 2005 14:13:03 -0000
@@ -138,8 +138,6 @@ static int simple_overlay_update_1 (stru
 
 static void add_filename_language (char *ext, enum language lang);
 
-static void set_ext_lang_command (char *args, int from_tty);
-
 static void info_ext_lang_command (char *args, int from_tty);
 
 static char *find_separate_debug_file (struct objfile *objfile);
@@ -2090,7 +2088,7 @@ add_filename_language (char *ext, enum l
 static char *ext_args;
 
 static void
-set_ext_lang_command (char *args, int from_tty)
+set_ext_lang_command (char *args, int from_tty, struct cmd_list_element *e)
 {
   int i;
   char *cp = ext_args;
@@ -3596,12 +3594,14 @@ for access from GDB."), &cmdlist);
 
   /* Filename extension to source language lookup table: */
   init_filename_language_table ();
-  c = add_set_cmd ("extension-language", class_files, var_string_noescape,
-		   (char *) &ext_args,
-		   "Set mapping between filename extension and source language.\n\
-Usage: set extension-language .foo bar",
-		   &setlist);
-  set_cmd_cfunc (c, set_ext_lang_command);
+  add_setshow_string_noescape_cmd ("extension-language", class_files,
+				   &ext_args, _("\
+Set mapping between filename extension and source language."), _("\
+Show mapping between filename extension and source language."), _("\
+Usage: set extension-language .foo bar"),
+				   NULL, /* FIXME: i18n: */
+				   set_ext_lang_command, NULL,
+				   &setlist, &showlist);
 
   add_info ("extensions", info_ext_lang_command,
 	    _("All filename extensions associated with a source language."));
Index: wince.c
===================================================================
RCS file: /cvs/src/src/gdb/wince.c,v
retrieving revision 1.39
diff -p -u -r1.39 wince.c
--- wince.c	11 Feb 2005 04:06:09 -0000	1.39
+++ wince.c	16 Feb 2005 14:13:04 -0000
@@ -2020,22 +2020,22 @@ _initialize_wince (void)
   struct cmd_list_element *set;
   init_child_ops ();
 
-  deprecated_add_show_from_set
-    (add_set_cmd ((char *) "remotedirectory", no_class,
-		  var_string_noescape, (char *) &remote_directory,
-		  (char *) "Set directory for remote upload.\n",
-		  &setlist),
-     &showlist);
+  add_setshow_string_noescape_cmd ("remotedirectory", no_class,
+				   &remote_directory, _("\
+Set directory for remote upload."), _("\
+Show directory for remote upload."), NULL,
+				   NULL, /* FIXME: i18n: */
+				   NULL, NULL,
+				   &setlist, &showlist);
   remote_directory = xstrdup (remote_directory);
 
-  set = add_set_cmd ((char *) "remoteupload", no_class,
-		     var_string_noescape, (char *) &remote_upload,
-		     (char *) "\
-Set how to upload executables to remote device.\n",
-		     &setlist);
-
-  deprecated_add_show_from_set (set, &showlist);
-  set_cmd_cfunc (set, set_upload_type);
+  add_setshow_string_noescape_cmd ("remoteupload", no_class,
+				   &remote_upload, _("\
+Set how to upload executables to remote device."), _("\
+Show how to upload executables to remote device."), NULL,
+				   NULL, /* FIXME: i18n: */
+				   set_upload_type, NULL,
+				   &setlist, &showlist);
   set_upload_type (NULL, 0);
 
   deprecated_add_show_from_set
Index: cli/cli-decode.c
===================================================================
RCS file: /cvs/src/src/gdb/cli/cli-decode.c,v
retrieving revision 1.46
diff -p -u -r1.46 cli-decode.c
--- cli/cli-decode.c	11 Feb 2005 04:06:10 -0000	1.46
+++ cli/cli-decode.c	16 Feb 2005 14:13:04 -0000
@@ -525,6 +525,26 @@ add_setshow_string_cmd (char *name, enum
 }
 
 /* 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_noescape_cmd (char *name, enum command_class class,
+			  char **var,
+			  const char *set_doc, const char *show_doc,
+			  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_noescape, var,
+			set_doc, show_doc, help_doc, fprint_setshow,
+			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 Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]