]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/maint.c
FT32: support for FT32B processor - part 2/2
[thirdparty/binutils-gdb.git] / gdb / maint.c
index b540d1c6bba64594d2ade081cd0fde2b53f9e392..65a056b25fcd9eae082873c6901666af77a0cef4 100644 (file)
 #include "cli/cli-utils.h"
 #include "cli/cli-setshow.h"
 
-static void maintenance_command (char *, int);
-
 static void maintenance_internal_error (char *args, int from_tty);
 
-static void maintenance_demangle (char *, int);
-
-static void maintenance_time_display (char *, int);
-
 static void maintenance_space_display (char *, int);
 
-static void maintenance_info_command (char *, int);
-
-static void maintenance_info_sections (char *, int);
-
-static void maintenance_print_command (char *, int);
-
-static void maintenance_do_deprecate (char *, int);
+static void maintenance_do_deprecate (const char *, int);
 
 /* Set this to the maximum number of seconds to wait instead of waiting forever
    in target_wait().  If this timer times out, then it generates an error and
@@ -79,7 +67,7 @@ show_watchdog (struct ui_file *file, int from_tty,
 /* Access the maintenance subcommands.  */
 
 static void
-maintenance_command (char *args, int from_tty)
+maintenance_command (const char *args, int from_tty)
 {
   printf_unfiltered (_("\"maintenance\" must be followed by "
                       "the name of a maintenance command.\n"));
@@ -88,7 +76,7 @@ maintenance_command (char *args, int from_tty)
 
 #ifndef _WIN32
 static void
-maintenance_dump_me (char *args, int from_tty)
+maintenance_dump_me (const char *args, int from_tty)
 {
   if (query (_("Should GDB dump core? ")))
     {
@@ -140,13 +128,13 @@ maintenance_demangler_warning (char *args, int from_tty)
    "mt demangler-warning" which artificially creates an internal gdb error.  */
 
 static void
-maintenance_demangle (char *args, int from_tty)
+maintenance_demangle (const char *args, int from_tty)
 {
   printf_filtered (_("This command has been moved to \"demangle\".\n"));
 }
 
 static void
-maintenance_time_display (char *args, int from_tty)
+maintenance_time_display (const char *args, int from_tty)
 {
   if (args == NULL || *args == '\0')
     printf_unfiltered (_("\"maintenance time\" takes a numeric argument.\n"));
@@ -168,7 +156,7 @@ maintenance_space_display (char *args, int from_tty)
    "maintenance info" with no args.  */
 
 static void
-maintenance_info_command (char *arg, int from_tty)
+maintenance_info_command (const char *arg, int from_tty)
 {
   printf_unfiltered (_("\"maintenance info\" must be followed "
                       "by the name of an info command.\n"));
@@ -181,7 +169,7 @@ maintenance_info_command (char *arg, int from_tty)
    "maintenance check" with no args.  */
 
 static void
-maintenance_check_command (char *arg, int from_tty)
+maintenance_check_command (const char *arg, int from_tty)
 {
   printf_unfiltered (_("\"maintenance check\" must be followed "
                       "by the name of a check command.\n"));
@@ -354,7 +342,7 @@ print_objfile_section_info (bfd *abfd,
 }
 
 static void
-maintenance_info_sections (char *arg, int from_tty)
+maintenance_info_sections (const char *arg, int from_tty)
 {
   if (exec_bfd)
     {
@@ -385,7 +373,7 @@ maintenance_info_sections (char *arg, int from_tty)
            }
        }
       else 
-       bfd_map_over_sections (exec_bfd, print_bfd_section_info, arg);
+       bfd_map_over_sections (exec_bfd, print_bfd_section_info, (void *) arg);
     }
 
   if (core_bfd)
@@ -394,12 +382,12 @@ maintenance_info_sections (char *arg, int from_tty)
       printf_filtered ("    `%s', ", bfd_get_filename (core_bfd));
       wrap_here ("        ");
       printf_filtered (_("file type %s.\n"), bfd_get_target (core_bfd));
-      bfd_map_over_sections (core_bfd, print_bfd_section_info, arg);
+      bfd_map_over_sections (core_bfd, print_bfd_section_info, (void *) arg);
     }
 }
 
 static void
-maintenance_print_statistics (char *args, int from_tty)
+maintenance_print_statistics (const char *args, int from_tty)
 {
   print_objfile_statistics ();
   print_symbol_bcache_statistics ();
@@ -427,7 +415,7 @@ maintenance_print_architecture (char *args, int from_tty)
    "maintenance print" with no args.  */
 
 static void
-maintenance_print_command (char *arg, int from_tty)
+maintenance_print_command (const char *arg, int from_tty)
 {
   printf_unfiltered (_("\"maintenance print\" must be followed "
                       "by the name of a print command.\n"));
@@ -525,7 +513,7 @@ maintenance_translate_address (char *arg, int from_tty)
    offered.  */
 
 static void
-maintenance_deprecate (char *args, int from_tty)
+maintenance_deprecate (const char *args, int from_tty)
 {
   if (args == NULL || *args == '\0')
     {
@@ -535,12 +523,11 @@ enclosed in quotes.\n"));
     }
 
   maintenance_do_deprecate (args, 1);
-
 }
 
 
 static void
-maintenance_undeprecate (char *args, int from_tty)
+maintenance_undeprecate (const char *args, int from_tty)
 {
   if (args == NULL || *args == '\0')
     {
@@ -549,7 +536,6 @@ the command you want to undeprecate.\n"));
     }
 
   maintenance_do_deprecate (args, 0);
-
 }
 
 /* You really shouldn't be using this.  It is just for the testsuite.
@@ -560,14 +546,14 @@ the command you want to undeprecate.\n"));
    replacement.  */
 
 static void
-maintenance_do_deprecate (char *text, int deprecate)
+maintenance_do_deprecate (const char *text, int deprecate)
 {
   struct cmd_list_element *alias = NULL;
   struct cmd_list_element *prefix_cmd = NULL;
   struct cmd_list_element *cmd = NULL;
 
-  char *start_ptr = NULL;
-  char *end_ptr = NULL;
+  const char *start_ptr = NULL;
+  const char *end_ptr = NULL;
   int len;
   char *replacement = NULL;
 
@@ -591,8 +577,7 @@ maintenance_do_deprecate (char *text, int deprecate)
          if (end_ptr != NULL)
            {
              len = end_ptr - start_ptr;
-             start_ptr[len] = '\0';
-             replacement = xstrdup (start_ptr);
+             replacement = savestring (start_ptr, len);
            }
        }
     }
@@ -653,7 +638,7 @@ struct cmd_list_element *maintenance_set_cmdlist;
 struct cmd_list_element *maintenance_show_cmdlist;
 
 static void
-maintenance_set_cmd (char *args, int from_tty)
+maintenance_set_cmd (const char *args, int from_tty)
 {
   printf_unfiltered (_("\"maintenance set\" must be followed "
                       "by the name of a set command.\n"));
@@ -662,7 +647,7 @@ maintenance_set_cmd (char *args, int from_tty)
 }
 
 static void
-maintenance_show_cmd (char *args, int from_tty)
+maintenance_show_cmd (const char *args, int from_tty)
 {
   cmd_show_list (maintenance_show_cmdlist, from_tty, "");
 }
@@ -925,7 +910,7 @@ scoped_command_stats::scoped_command_stats (bool msg_type)
    In this case have "mt set per-command on|off" affect every setting.  */
 
 static void
-set_per_command_cmd (char *args, int from_tty)
+set_per_command_cmd (const char *args, int from_tty)
 {
   struct cmd_list_element *list;
   int val;
@@ -946,7 +931,7 @@ set_per_command_cmd (char *args, int from_tty)
    "show per-command " settings.  */
 
 static void
-show_per_command_cmd (char *args, int from_tty)
+show_per_command_cmd (const char *args, int from_tty)
 {
   cmd_show_list (per_command_showlist, from_tty, "");
 }
@@ -955,7 +940,7 @@ show_per_command_cmd (char *args, int from_tty)
 /* The "maintenance selftest" command.  */
 
 static void
-maintenance_selftest (char *args, int from_tty)
+maintenance_selftest (const char *args, int from_tty)
 {
   selftests::run_tests (args);
 }