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] Delete unused add_set/show functions


FYI, gone,
Andrew
2005-02-21  Andrew Cagney  <cagney@gnu.org>

	* cli/cli-decode.c (add_set_enum_cmd): Delete function.
	(deprecated_add_show_from_set): Delete function.
	* command.h (add_set_enum_cmd): Delete declaration.
	(deprecated_add_show_from_set): Delete declaration.
	* cli/cli-decode.h (add_set_enum_cmd): Delete declaration.
	(deprecated_add_show_from_set): Delete declaration.
	* arm-tdep.c (_initialize_arm_tdep): Update comment.
	* kod.c (kod_set_os): Simplify.
	* infrun.c (set_schedlock_func): Simplify.
	* cli/cli-dump.c (add_dump_command): Update comment.

Index: arm-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/arm-tdep.c,v
retrieving revision 1.192
diff -p -u -r1.192 arm-tdep.c
--- arm-tdep.c	17 Feb 2005 13:49:48 -0000	1.192
+++ arm-tdep.c	21 Feb 2005 07:12:02 -0000
@@ -2848,7 +2848,8 @@ _initialize_arm_tdep (void)
   /* Sync the opcode insn printer with our register viewer.  */
   parse_arm_disassembler_option ("reg-names-std");
 
-  /* Initialize the array that will be passed to add_set_enum_cmd().  */
+  /* Initialize the array that will be passed to
+     add_setshow_enum_cmd().  */
   valid_disassembly_styles
     = xmalloc ((num_disassembly_options + 1) * sizeof (char *));
   for (i = 0; i < num_disassembly_options; i++)
Index: command.h
===================================================================
RCS file: /cvs/src/src/gdb/command.h,v
retrieving revision 1.50
diff -p -u -r1.50 command.h
--- command.h	21 Feb 2005 03:25:56 -0000	1.50
+++ command.h	21 Feb 2005 07:12:02 -0000
@@ -156,15 +156,6 @@ extern void execute_cmd_pre_hook (struct
 extern void execute_cmd_post_hook (struct cmd_list_element *cmd);
 
 /* Return the type of the command.  */
-/* NOTE: cagney/2002-03-17: The deprecated_add_show_from_set()
-   function clones the set command passed as a parameter.  The clone
-   operation will include (BUG?) any ``set'' command callback, if
-   present.  Commands like ``info set'' call all the ``show'' command
-   callbacks.  Unfortunately, for ``show'' commands cloned from
-   ``set'', this includes callbacks belonging to ``set'' commands.
-   Making this worse, this only occures if
-   deprecated_add_show_from_set() is called after add_cmd_sfunc()
-   (BUG?).  */
 extern enum cmd_types cmd_type (struct cmd_list_element *cmd);
 
 
@@ -220,13 +211,6 @@ extern struct cmd_list_element *add_set_
 					     char *doc,
 					     struct cmd_list_element **list);
 
-extern struct cmd_list_element *add_set_enum_cmd (char *name,
-						  enum command_class class,
-						  const char *enumlist[],
-						  const char **var,
-						  char *doc,
-						  struct cmd_list_element **list);
-
 /* Method for show a set/show variable's VALUE on FILE.  If this
    method isn't supplied deprecated_show_value_hack() is called (which
    is not good).  */
@@ -348,9 +332,6 @@ extern void add_setshow_zinteger_cmd (ch
 				      struct cmd_list_element **set_list,
 				      struct cmd_list_element **show_list);
 
-extern struct cmd_list_element *deprecated_add_show_from_set (struct cmd_list_element *,
-							      struct cmd_list_element **);
-
 /* Do a "show" command for each thing on a command list.  */
 
 extern void cmd_show_list (struct cmd_list_element *, int, char *);
Index: infrun.c
===================================================================
RCS file: /cvs/src/src/gdb/infrun.c,v
retrieving revision 1.197
diff -p -u -r1.197 infrun.c
--- infrun.c	21 Feb 2005 04:31:58 -0000	1.197
+++ infrun.c	21 Feb 2005 07:12:04 -0000
@@ -469,21 +469,11 @@ static const char *scheduler_enums[] = {
 static void
 set_schedlock_func (char *args, int from_tty, struct cmd_list_element *c)
 {
-  /* NOTE: cagney/2002-03-17: The deprecated_add_show_from_set()
-     function clones the set command passed as a parameter.  The clone
-     operation will include (BUG?) any ``set'' command callback, if
-     present.  Commands like ``info set'' call all the ``show''
-     command callbacks.  Unfortunately, for ``show'' commands cloned
-     from ``set'', this includes callbacks belonging to ``set''
-     commands.  Making this worse, this only occures if
-     deprecated_add_show_from_set() is called after add_cmd_sfunc()
-     (BUG?).  */
-  if (cmd_type (c) == set_cmd)
-    if (!target_can_lock_scheduler)
-      {
-	scheduler_mode = schedlock_off;
-	error (_("Target '%s' cannot support this command."), target_shortname);
-      }
+  if (!target_can_lock_scheduler)
+    {
+      scheduler_mode = schedlock_off;
+      error (_("Target '%s' cannot support this command."), target_shortname);
+    }
 }
 
 
Index: kod.c
===================================================================
RCS file: /cvs/src/src/gdb/kod.c,v
retrieving revision 1.14
diff -p -u -r1.14 kod.c
--- kod.c	21 Feb 2005 06:21:07 -0000	1.14
+++ kod.c	21 Feb 2005 07:12:05 -0000
@@ -134,19 +134,6 @@ kod_set_os (char *arg, int from_tty, str
 {
   char *p;
 
-  /* NOTE: cagney/2002-03-17: The deprecated_add_show_from_set()
-     function clones the set command passed as a parameter.  The clone
-     operation will include (BUG?) any ``set'' command callback, if
-     present.  Commands like ``info set'' call all the ``show''
-     command callbacks.  Unfortunately, for ``show'' commands cloned
-     from ``set'', this includes callbacks belonging to ``set''
-     commands.  Making this worse, this only occures if
-     deprecated_add_show_from_set() is called after add_cmd_sfunc()
-     (BUG?).  */
-
-  if (cmd_type (command) != set_cmd)
-    return;
-
   /* If we had already had an open OS, close it.  */
   if (gdb_kod_close)
     (*gdb_kod_close) ();
Index: cli/cli-decode.c
===================================================================
RCS file: /cvs/src/src/gdb/cli/cli-decode.c,v
retrieving revision 1.52
diff -p -u -r1.52 cli-decode.c
--- cli/cli-decode.c	21 Feb 2005 03:25:56 -0000	1.52
+++ cli/cli-decode.c	21 Feb 2005 07:12:05 -0000
@@ -378,29 +378,6 @@ add_set_cmd (char *name,
   return add_set_or_show_cmd (name, set_cmd, class, var_type, var, doc, list);
 }
 
-/* Add element named NAME to command list LIST (the list for set
-   or some sublist thereof).
-   CLASS is as in add_cmd.
-   ENUMLIST is a list of strings which may follow NAME.
-   VAR is address of the variable which will contain the matching string
-   (from ENUMLIST).
-   DOC is the documentation string.  */
-
-struct cmd_list_element *
-add_set_enum_cmd (char *name,
-		  enum command_class class,
-		  const char *enumlist[],
-		  const char **var,
-		  char *doc,
-		  struct cmd_list_element **list)
-{
-  struct cmd_list_element *c
-  = add_set_cmd (name, class, var_enum, var, doc, list);
-  c->enums = enumlist;
-
-  return c;
-}
-
 /* Add element named NAME to command list LIST (the list for set or
    some sublist thereof).  CLASS is as in add_cmd.  ENUMLIST is a list
    of strings which may follow NAME.  VAR is address of the variable
@@ -617,33 +594,6 @@ add_setshow_zinteger_cmd (char *name, en
 			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).  */
-/* NOTE: cagney/2002-03-17: The original version of
-   deprecated_add_show_from_set used memcpy() to clone `set' into
-   `show'.  This meant that in addition to all the needed fields (var,
-   name, et.al.) some unnecessary fields were copied (namely the
-   callback function).  The function explictly copies relevant fields.
-   For a `set' and `show' command to share the same callback, the
-   caller must set both explicitly.  */
-struct cmd_list_element *
-deprecated_add_show_from_set (struct cmd_list_element *setcmd,
-			      struct cmd_list_element **list)
-{
-  char *doc;
-  const static char setstring[] = "Set ";
-
-  /* Create a doc string by replacing "Set " at the start of the
-     `set'' command's doco with "Show ".  */
-  gdb_assert (strncmp (setcmd->doc, setstring, sizeof (setstring) - 1) == 0);
-  doc = concat ("Show ", setcmd->doc + sizeof (setstring) - 1, NULL);
-
-  /* Insert the basic command.  */
-  return add_set_or_show_cmd (setcmd->name, show_cmd, setcmd->class,
-			      setcmd->var_type, setcmd->var, doc, list);
-}
-
 /* Remove the command named NAME from the command list.  */
 
 void
Index: cli/cli-decode.h
===================================================================
RCS file: /cvs/src/src/gdb/cli/cli-decode.h,v
retrieving revision 1.21
diff -p -u -r1.21 cli-decode.h
--- cli/cli-decode.h	16 Feb 2005 17:20:59 -0000	1.21
+++ cli/cli-decode.h	21 Feb 2005 07:12:06 -0000
@@ -292,16 +292,6 @@ extern struct cmd_list_element *add_set_
 					     char *doc,
 					     struct cmd_list_element **list);
 
-extern struct cmd_list_element *add_set_enum_cmd (char *name,
-						  enum command_class class,
-						  const char *enumlist[],
-						  const char **var,
-						  char *doc,
-						  struct cmd_list_element **list);
-
-extern struct cmd_list_element *deprecated_add_show_from_set (struct cmd_list_element *,
-							      struct cmd_list_element **);
-
 /* Functions that implement commands about CLI commands. */
 
 extern void help_cmd (char *, struct ui_file *);
Index: cli/cli-dump.c
===================================================================
RCS file: /cvs/src/src/gdb/cli/cli-dump.c,v
retrieving revision 1.19
diff -p -u -r1.19 cli-dump.c
--- cli/cli-dump.c	15 Feb 2005 15:49:26 -0000	1.19
+++ cli/cli-dump.c	21 Feb 2005 07:12:08 -0000
@@ -429,7 +429,7 @@ add_dump_command (char *name, void (*fun
   c->func = call_dump_func;
 
   /* Replace "Dump " at start of docstring with "Append " (borrowed
-     from deprecated_add_show_from_set).  */
+     from [deleted] deprecated_add_show_from_set).  */
   if (   c->doc[0] == 'W' 
       && c->doc[1] == 'r' 
       && c->doc[2] == 'i'

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