Copyright year update in most files of the GDB Project.
[deliverable/binutils-gdb.git] / gdb / maint.c
index 52652c5626f6b9e752003941f4693aa05d20c758..6a106fd387c391f348c075c20a235359a09df068 100644 (file)
@@ -1,7 +1,7 @@
 /* Support for GDB maintenance commands.
 
-   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2002,
-   2003, 2004, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+   Copyright (C) 1992-1997, 1999-2004, 2007-2012 Free Software
+   Foundation, Inc.
 
    Written by Fred Fish at Cygnus Support.
 
@@ -74,19 +74,7 @@ show_watchdog (struct ui_file *file, int from_tty,
   fprintf_filtered (file, _("Watchdog timer is %s.\n"), value);
 }
 
-/*
-
-   LOCAL FUNCTION
-
-   maintenance_command -- access the maintenance subcommands
-
-   SYNOPSIS
-
-   void maintenance_command (char *args, int from_tty)
-
-   DESCRIPTION
-
- */
+/* Access the maintenance subcommands.  */
 
 static void
 maintenance_command (char *args, int from_tty)
@@ -117,7 +105,7 @@ maintenance_dump_me (char *args, int from_tty)
 /* Stimulate the internal error mechanism that GDB uses when an
    internal problem is detected.  Allows testing of the mechanism.
    Also useful when the user wants to drop a core file but not exit
-   GDB. */
+   GDB.  */
 
 static void
 maintenance_internal_error (char *args, int from_tty)
@@ -128,7 +116,7 @@ maintenance_internal_error (char *args, int from_tty)
 /* Stimulate the internal error mechanism that GDB uses when an
    internal problem is detected.  Allows testing of the mechanism.
    Also useful when the user wants to drop a core file but not exit
-   GDB. */
+   GDB.  */
 
 static void
 maintenance_internal_warning (char *args, int from_tty)
@@ -142,7 +130,7 @@ maintenance_internal_warning (char *args, int from_tty)
    debuggee's process space, and have gdb fetch and demangle that
    string.  If we have a char* pointer "ptr" that points to a string,
    we might want to be able to given just the name and have GDB
-   demangle and print what it points to, etc.  (FIXME) */
+   demangle and print what it points to, etc.  (FIXME)  */
 
 static void
 maintenance_demangle (char *args, int from_tty)
@@ -210,12 +198,12 @@ match_substring (const char *string, const char *substr)
 
   while ((tok = strstr (string, substr)) != NULL)
     {
-      /* Got a partial match.  Is it a whole word? */
+      /* Got a partial match.  Is it a whole word?  */
       if (tok == string
          || tok[-1] == ' '
          || tok[-1] == '\t')
       {
-       /* Token is delimited at the front... */
+       /* Token is delimited at the front...  */
        if (tok[substr_len] == ' '
            || tok[substr_len] == '\t'
            || tok[substr_len] == '\0')
@@ -449,8 +437,7 @@ maintenance_print_command (char *arg, int from_tty)
 /* The "maintenance translate-address" command converts a section and address
    to a symbol.  This can be called in two ways:
    maintenance translate-address <secname> <addr>
-   or   maintenance translate-address <addr>
- */
+   or   maintenance translate-address <addr>.  */
 
 static void
 maintenance_translate_address (char *arg, int from_tty)
@@ -468,14 +455,14 @@ maintenance_translate_address (char *arg, int from_tty)
   p = arg;
 
   if (!isdigit (*p))
-    {                          /* See if we have a valid section name */
-      while (*p && !isspace (*p))      /* Find end of section name */
+    {                          /* See if we have a valid section name */
+      while (*p && !isspace (*p))      /* Find end of section name */
        p++;
-      if (*p == '\000')                /* End of command? */
+      if (*p == '\000')                /* End of command?  */
        error (_("Need to specify <section-name> and <address>"));
       *p++ = '\000';
       while (isspace (*p))
-       p++;                    /* Skip whitespace */
+       p++;                    /* Skip whitespace */
 
       ALL_OBJSECTIONS (objfile, sect)
       {
@@ -535,7 +522,7 @@ maintenance_translate_address (char *arg, int from_tty)
 
 /* When a command is deprecated the user will be warned the first time
    the command is used.  If possible, a replacement will be
-   offered. */
+   offered.  */
 
 static void
 maintenance_deprecate (char *args, int from_tty)
@@ -565,7 +552,7 @@ the command you want to undeprecate.\n"));
 
 }
 
-/* You really shouldn't be using this. It is just for the testsuite.
+/* You really shouldn't be using this.  It is just for the testsuite.
    Rather, you should use deprecate_cmd() when the command is created
    in _initialize_blah().
 
@@ -595,7 +582,7 @@ maintenance_do_deprecate (char *text, int deprecate)
 
   if (deprecate)
     {
-      /* look for a replacement command */
+      /* Look for a replacement command.  */
       start_ptr = strchr (text, '\"');
       if (start_ptr != NULL)
        {
@@ -618,7 +605,7 @@ maintenance_do_deprecate (char *text, int deprecate)
 
      Note the MALLOCED_REPLACEMENT test.  If the command's replacement
      string was allocated at compile time we don't want to free the
-     memory. */
+     memory.  */
   if (alias)
     {
       if (alias->flags & MALLOCED_REPLACEMENT)
@@ -645,6 +632,7 @@ maintenance_do_deprecate (char *text, int deprecate)
       cmd->flags |= MALLOCED_REPLACEMENT;
       return;
     }
+  xfree (replacement);
 }
 
 /* Maintenance set/show framework.  */
This page took 0.026802 seconds and 4 git commands to generate.