Constify add_info
authorTom Tromey <tom@tromey.com>
Sat, 14 Oct 2017 04:07:26 +0000 (22:07 -0600)
committerTom Tromey <tom@tromey.com>
Tue, 7 Nov 2017 20:59:09 +0000 (13:59 -0700)
This patch constifies add_info and updates all the info commands.  The
bulk of this patch was written using a script; and then I did a manual
pass to fix up the remaining compilation errors.

I could not compile every changed file; in particular nto-procfs.c,
gnu-nat.c, and darwin-nat-info.c; but I at least tried to check the
correctness by inspection.

gdb/ChangeLog
2017-11-07  Tom Tromey  <tom@tromey.com>

* frame.h (info_locals_command, info_args_command): Constify.
* auto-load.h (auto_load_info_scripts): Constify.
* inferior.h (registers_info): Constify.
* copying.c: Rebuild.
* copying.awk: Constify generated commands.
* auto-load.c (auto_load_info_scripts)
(info_auto_load_gdb_scripts): Constify.
* cli/cli-decode.c (struct cmd_list_element): Take a
cmd_const_cfunc_ftype.
* command.h (add_info): Take a cmd_const_cfunc_ftype.
* tui/tui-win.c (tui_all_windows_info): Constify.
* python/py-auto-load.c (info_auto_load_python_scripts):
Constify.
* cli/cli-cmds.c (show_command): Remove non-const overload.
* tracepoint.c (info_tvariables_command, info_scope_command):
Constify.
(info_static_tracepoint_markers_command): Constify.
* thread.c (info_threads_command): Constify.
(print_thread_info_1): Constify.
* target.c (info_target_command): Constify.
* symtab.c (info_sources_command, info_functions_command)
(info_types_command): Constify.
(info_variables_command): Remove non-const overload.
* symfile.c (info_ext_lang_command): Constify.
* stack.c (info_frame_command, info_locals_command)
(info_args_command): Constify.
(backtrace_command): Remove non-const overload.
* source.c (info_source_command, info_line_command): Constify.
* solib.c (info_sharedlibrary_command): Constify.
* skip.c (info_skip_command): Constify.
* ser-go32.c (info_serial_command): Constify.
* reverse.c (info_bookmarks_command): Constify.
* printcmd.c (info_symbol_command, info_address_command)
(info_display_command): Constify.
* osdata.c (info_osdata_command): Constify.
* objc-lang.c (info_selectors_command, info_classes_command):
Constify.
* nto-procfs.c (procfs_pidlist, procfs_meminfo): Constify.
* memattr.c (info_mem_command): Constify.
* macrocmd.c (info_macro_command, info_macros_command): Constify.
* linux-fork.c (info_checkpoints_command): Constify.
* infrun.c (info_signals_command): Constify.
* inflow.c (info_terminal_command): Constify.
* inferior.c (info_inferiors_command): Constify.
(print_inferior): Constify.
* infcmd.c (info_program_command, info_all_registers_command)
(info_registers_command, info_vector_command)
(info_float_command): Constify.
(registers_info): Constify.
* gnu-nat.c (info_send_rights_cmd, info_recv_rights_cmd)
(info_port_sets_cmd, info_dead_names_cmd, info_port_rights_cmd):
Constify.
* f-valprint.c (info_common_command): Constify.
* dcache.c (info_dcache_command): Constify.
(dcache_info_1): Constify.
* darwin-nat-info.c (info_mach_tasks_command)
(info_mach_task_command, info_mach_ports_command)
(info_mach_port_command, info_mach_threads_command)
(info_mach_thread_command, info_mach_regions_command)
(info_mach_regions_recurse_command, info_mach_region_command)
(info_mach_exceptions_command): Constify.
(get_task_from_args): Constify.
* cp-support.c (info_vtbl_command): Constify.
* breakpoint.c (info_watchpoints_command)
(info_tracepoints_command): Constify.
(info_breakpoints_command): Remove non-const overload.
* avr-tdep.c (avr_io_reg_read_command): Constify.
* auxv.c (info_auxv_command): Constify.
* ada-tasks.c (info_tasks_command): Constify.
(info_task): Constify.
* ada-lang.c (info_exceptions_command): Constify.

44 files changed:
gdb/ChangeLog
gdb/ada-lang.c
gdb/ada-tasks.c
gdb/auto-load.c
gdb/auto-load.h
gdb/auxv.c
gdb/avr-tdep.c
gdb/breakpoint.c
gdb/cli/cli-cmds.c
gdb/cli/cli-decode.c
gdb/command.h
gdb/copying.awk
gdb/copying.c
gdb/cp-support.c
gdb/darwin-nat-info.c
gdb/dcache.c
gdb/f-valprint.c
gdb/frame.h
gdb/gnu-nat.c
gdb/infcmd.c
gdb/inferior.c
gdb/inferior.h
gdb/inflow.c
gdb/infrun.c
gdb/linux-fork.c
gdb/macrocmd.c
gdb/memattr.c
gdb/nto-procfs.c
gdb/objc-lang.c
gdb/osdata.c
gdb/printcmd.c
gdb/python/py-auto-load.c
gdb/reverse.c
gdb/ser-go32.c
gdb/skip.c
gdb/solib.c
gdb/source.c
gdb/stack.c
gdb/symfile.c
gdb/symtab.c
gdb/target.c
gdb/thread.c
gdb/tracepoint.c
gdb/tui/tui-win.c

index 25ece7f95b100d1538c35c8d7bd9098f75a9b7a3..94cee5f379a846dc7de5d17196906543ce27af5f 100644 (file)
@@ -1,3 +1,77 @@
+2017-11-07  Tom Tromey  <tom@tromey.com>
+
+       * frame.h (info_locals_command, info_args_command): Constify.
+       * auto-load.h (auto_load_info_scripts): Constify.
+       * inferior.h (registers_info): Constify.
+       * copying.c: Rebuild.
+       * copying.awk: Constify generated commands.
+       * auto-load.c (auto_load_info_scripts)
+       (info_auto_load_gdb_scripts): Constify.
+       * cli/cli-decode.c (struct cmd_list_element): Take a
+       cmd_const_cfunc_ftype.
+       * command.h (add_info): Take a cmd_const_cfunc_ftype.
+       * tui/tui-win.c (tui_all_windows_info): Constify.
+       * python/py-auto-load.c (info_auto_load_python_scripts):
+       Constify.
+       * cli/cli-cmds.c (show_command): Remove non-const overload.
+       * tracepoint.c (info_tvariables_command, info_scope_command):
+       Constify.
+       (info_static_tracepoint_markers_command): Constify.
+       * thread.c (info_threads_command): Constify.
+       (print_thread_info_1): Constify.
+       * target.c (info_target_command): Constify.
+       * symtab.c (info_sources_command, info_functions_command)
+       (info_types_command): Constify.
+       (info_variables_command): Remove non-const overload.
+       * symfile.c (info_ext_lang_command): Constify.
+       * stack.c (info_frame_command, info_locals_command)
+       (info_args_command): Constify.
+       (backtrace_command): Remove non-const overload.
+       * source.c (info_source_command, info_line_command): Constify.
+       * solib.c (info_sharedlibrary_command): Constify.
+       * skip.c (info_skip_command): Constify.
+       * ser-go32.c (info_serial_command): Constify.
+       * reverse.c (info_bookmarks_command): Constify.
+       * printcmd.c (info_symbol_command, info_address_command)
+       (info_display_command): Constify.
+       * osdata.c (info_osdata_command): Constify.
+       * objc-lang.c (info_selectors_command, info_classes_command):
+       Constify.
+       * nto-procfs.c (procfs_pidlist, procfs_meminfo): Constify.
+       * memattr.c (info_mem_command): Constify.
+       * macrocmd.c (info_macro_command, info_macros_command): Constify.
+       * linux-fork.c (info_checkpoints_command): Constify.
+       * infrun.c (info_signals_command): Constify.
+       * inflow.c (info_terminal_command): Constify.
+       * inferior.c (info_inferiors_command): Constify.
+       (print_inferior): Constify.
+       * infcmd.c (info_program_command, info_all_registers_command)
+       (info_registers_command, info_vector_command)
+       (info_float_command): Constify.
+       (registers_info): Constify.
+       * gnu-nat.c (info_send_rights_cmd, info_recv_rights_cmd)
+       (info_port_sets_cmd, info_dead_names_cmd, info_port_rights_cmd):
+       Constify.
+       * f-valprint.c (info_common_command): Constify.
+       * dcache.c (info_dcache_command): Constify.
+       (dcache_info_1): Constify.
+       * darwin-nat-info.c (info_mach_tasks_command)
+       (info_mach_task_command, info_mach_ports_command)
+       (info_mach_port_command, info_mach_threads_command)
+       (info_mach_thread_command, info_mach_regions_command)
+       (info_mach_regions_recurse_command, info_mach_region_command)
+       (info_mach_exceptions_command): Constify.
+       (get_task_from_args): Constify.
+       * cp-support.c (info_vtbl_command): Constify.
+       * breakpoint.c (info_watchpoints_command)
+       (info_tracepoints_command): Constify.
+       (info_breakpoints_command): Remove non-const overload.
+       * avr-tdep.c (avr_io_reg_read_command): Constify.
+       * auxv.c (info_auxv_command): Constify.
+       * ada-tasks.c (info_tasks_command): Constify.
+       (info_task): Constify.
+       * ada-lang.c (info_exceptions_command): Constify.
+
 2017-11-07  Tom Tromey  <tom@tromey.com>
 
        * solib.h (no_shared_libraries): Constify.
index 32b978c33cffaddee9afebecbe70129f570602ff..690ed651a6bcd5ec3c214a8fab876a94ed9fd54d 100644 (file)
@@ -13359,7 +13359,7 @@ ada_exceptions_list (const char *regexp)
 /* Implement the "info exceptions" command.  */
 
 static void
-info_exceptions_command (char *regexp, int from_tty)
+info_exceptions_command (const char *regexp, int from_tty)
 {
   struct gdbarch *gdbarch = get_current_arch ();
 
index e0070d5b9abeb439dae99cfd485a6ec991483ee3..1d5542d5d641e46921098aeae0b3ac2c288b19bc 100644 (file)
@@ -1147,7 +1147,7 @@ print_ada_task_info (struct ui_out *uiout,
    for the given inferior (INF).  */
 
 static void
-info_task (struct ui_out *uiout, char *taskno_str, struct inferior *inf)
+info_task (struct ui_out *uiout, const char *taskno_str, struct inferior *inf)
 {
   const int taskno = value_as_long (parse_and_eval (taskno_str));
   struct ada_task_info *task_info;
@@ -1237,7 +1237,7 @@ info_task (struct ui_out *uiout, char *taskno_str, struct inferior *inf)
    Does nothing if the program doesn't use Ada tasking.  */
 
 static void
-info_tasks_command (char *arg, int from_tty)
+info_tasks_command (const char *arg, int from_tty)
 {
   struct ui_out *uiout = current_uiout;
 
index 0ccef19491ef90cd4b8306b6a2afa4ae805f09d2..47533da7095c90ce87fe1b18c46f67eb62c4942d 100644 (file)
@@ -1290,7 +1290,7 @@ print_scripts (const std::vector<loaded_script *> &scripts)
    PATTERN.  FROM_TTY is the usual GDB boolean for user interactivity.  */
 
 void
-auto_load_info_scripts (char *pattern, int from_tty,
+auto_load_info_scripts (const char *pattern, int from_tty,
                        const struct extension_language_defn *language)
 {
   struct ui_out *uiout = current_uiout;
@@ -1373,7 +1373,7 @@ auto_load_info_scripts (char *pattern, int from_tty,
 /* Wrapper for "info auto-load gdb-scripts".  */
 
 static void
-info_auto_load_gdb_scripts (char *pattern, int from_tty)
+info_auto_load_gdb_scripts (const char *pattern, int from_tty)
 {
   auto_load_info_scripts (pattern, from_tty, &extension_language_gdb);
 }
index f8b5b0d7a790ca93ba574a5598b72a5a115823a7..f02a9043b11412cc3e5ff2c563de44eaa22bc929 100644 (file)
@@ -37,7 +37,7 @@ extern void auto_load_objfile_script (struct objfile *objfile,
                                      const struct extension_language_defn *);
 extern void load_auto_scripts_for_objfile (struct objfile *objfile);
 extern char auto_load_info_scripts_pattern_nl[];
-extern void auto_load_info_scripts (char *pattern, int from_tty,
+extern void auto_load_info_scripts (const char *pattern, int from_tty,
                                    const struct extension_language_defn *);
 
 extern struct cmd_list_element **auto_load_set_cmdlist_get (void);
index 95cbeecd797bf33385bc69d0d539fe53b67810e5..dfba94b4e1e0e0c4e8a9b093d075e3d4844023d0 100644 (file)
@@ -552,7 +552,7 @@ fprint_target_auxv (struct ui_file *file, struct target_ops *ops)
 }
 
 static void
-info_auxv_command (char *cmd, int from_tty)
+info_auxv_command (const char *cmd, int from_tty)
 {
   if (! target_has_stack)
     error (_("The program has no auxiliary information now."));
index 9aca8c32e5e7606bb704b32a59838d31d3970605..f4ce2706d45074109785f32195a38a290cc0b208 100644 (file)
@@ -1546,7 +1546,7 @@ avr_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
    All io registers are 8-bit.  */
 
 static void
-avr_io_reg_read_command (char *args, int from_tty)
+avr_io_reg_read_command (const char *args, int from_tty)
 {
   LONGEST bufsiz = 0;
   gdb_byte *buf;
index 4272378a6942d73cbb4359a3118eebb7f720d734..5645ecdeabf34f98276d4e3c96e5822920d03038 100644 (file)
@@ -161,8 +161,6 @@ static int breakpoint_location_address_range_overlap (struct bp_location *,
                                                      const address_space *,
                                                      CORE_ADDR, int);
 
-static void info_watchpoints_command (char *, int);
-
 static int remove_breakpoint (struct bp_location *);
 static int remove_breakpoint_1 (struct bp_location *, enum remove_bp_reason);
 
@@ -228,8 +226,6 @@ static int is_hardware_watchpoint (const struct breakpoint *bpt);
 
 static void insert_breakpoint_locations (void);
 
-static void info_tracepoints_command (char *, int);
-
 static void enable_trace_command (char *, int);
 
 static void disable_trace_command (char *, int);
@@ -6705,16 +6701,8 @@ info_breakpoints_command (const char *args, int from_tty)
   default_collect_info ();
 }
 
-/* Temporary non-const overload.  */
-
-static void
-info_breakpoints_command (char *args, int from_tty)
-{
-  info_breakpoints_command ((const char *) args, from_tty);
-}
-
 static void
-info_watchpoints_command (char *args, int from_tty)
+info_watchpoints_command (const char *args, int from_tty)
 {
   int num_printed = breakpoint_1 (args, 0, is_watchpoint);
   struct ui_out *uiout = current_uiout;
@@ -14919,7 +14907,7 @@ create_tracepoint_from_upload (struct uploaded_tp *utp)
    omitted.  */
 
 static void
-info_tracepoints_command (char *args, int from_tty)
+info_tracepoints_command (const char *args, int from_tty)
 {
   struct ui_out *uiout = current_uiout;
   int num_printed;
index be022d321526f950604c6070083cc4890809fecb..ccfedb2a5fa076018b69caa773102da29bd669b7 100644 (file)
@@ -207,14 +207,6 @@ show_command (const char *arg, int from_tty)
   cmd_show_list (showlist, from_tty, "");
 }
 
-/* A temporary non-const overload of show_command.  */
-
-static void
-show_command (char *arg, int from_tty)
-{
-  cmd_show_list (showlist, from_tty, "");
-}
-
 \f
 /* Provide documentation on command or list given by COMMAND.  FROM_TTY
    is ignored.  */
index e9baf38d132715b0ad69cf226b6d78e1ee538264..0c555268b30844368f28bff87aea978173589a89 100644 (file)
@@ -915,7 +915,7 @@ delete_cmd (const char *name, struct cmd_list_element **list,
 /* Add an element to the list of info subcommands.  */
 
 struct cmd_list_element *
-add_info (const char *name, cmd_cfunc_ftype *fun, const char *doc)
+add_info (const char *name, cmd_const_cfunc_ftype *fun, const char *doc)
 {
   return add_cmd (name, class_info, fun, doc, &infolist);
 }
index c3348bcedee157a24b4fb9893c1bf117ed7a6b6e..258f7f7de26c09cb2f19c898fbe4e8faa9526833 100644 (file)
@@ -268,7 +268,7 @@ extern struct cmd_list_element *add_com_suppress_notification
                        int *supress_notification);
 
 extern struct cmd_list_element *add_info (const char *,
-                                         cmd_cfunc_ftype *fun,
+                                         cmd_const_cfunc_ftype *fun,
                                          const char *);
 
 extern struct cmd_list_element *add_info_alias (const char *, const char *,
index 2a71939a6f501b641fb107bb752f32bb61b73614..1cd596a56411ae56b29b2b8ef26c1386350b8796 100644 (file)
@@ -10,12 +10,12 @@ BEGIN       {
          print "#include \"command.h\""
          print "#include \"gdbcmd.h\""
          print ""
-         print "static void show_copying_command (char *, int);"
+         print "static void show_copying_command (const char *, int);"
          print ""
-         print "static void show_warranty_command (char *, int);"
+         print "static void show_warranty_command (const char *, int);"
          print ""
          print "static void";
-         print "show_copying_command (char *ignore, int from_tty)";
+         print "show_copying_command (const char *ignore, int from_tty)";
          print "{";
        }
 NR == 1,/^[    ]*15\. Disclaimer of Warranty\.[        ]*$/    {
@@ -35,7 +35,7 @@ NR == 1,/^[   ]*15\. Disclaimer of Warranty\.[        ]*$/    {
          print "}";
          print "";
          print "static void";
-         print "show_warranty_command (char *ignore, int from_tty)";
+         print "show_warranty_command (const char *ignore, int from_tty)";
          print "{";
        }
 /^[    ]*15\. Disclaimer of Warranty\.[        ]*$/, /^[       ]*END OF TERMS AND CONDITIONS[  ]*$/{  
index db024627cd378442d2bce92f7391137ee594325f..8e4077ccb9104163cb7fe81e93565178b0bf44e9 100644 (file)
@@ -6,12 +6,12 @@
 #include "command.h"
 #include "gdbcmd.h"
 
-static void show_copying_command (char *, int);
+static void show_copying_command (const char *, int);
 
-static void show_warranty_command (char *, int);
+static void show_warranty_command (const char *, int);
 
 static void
-show_copying_command (char *ignore, int from_tty)
+show_copying_command (const char *ignore, int from_tty)
 {
   printf_filtered ("                    GNU GENERAL PUBLIC LICENSE\n");
   printf_filtered ("                       Version 3, 29 June 2007\n");
@@ -604,7 +604,7 @@ show_copying_command (char *ignore, int from_tty)
 }
 
 static void
-show_warranty_command (char *ignore, int from_tty)
+show_warranty_command (const char *ignore, int from_tty)
 {
   printf_filtered ("  15. Disclaimer of Warranty.\n");
   printf_filtered ("\n");
index 817de59f12f14c338934a76b8da0f16dc61d0c1a..6045cb06dd1aa3d1a9e9a4d14d9b3492fd996c9c 100644 (file)
@@ -1601,7 +1601,7 @@ first_component_command (const char *arg, int from_tty)
 /* Implement "info vtbl".  */
 
 static void
-info_vtbl_command (char *arg, int from_tty)
+info_vtbl_command (const char *arg, int from_tty)
 {
   struct value *value;
 
index fc9aeaaad735253f02d7668766f905b44ac8c0a4..44782bfa78d7d1417ea266ad904066d3e0ec66de 100644 (file)
@@ -66,7 +66,7 @@
 #define port_type_array_t mach_port_array_t
 
 static void
-info_mach_tasks_command (char *args, int from_tty)
+info_mach_tasks_command (const char *args, int from_tty)
 {
   int sysControl[4];
   int count, index;
@@ -109,7 +109,7 @@ info_mach_tasks_command (char *args, int from_tty)
 }
 
 static task_t
-get_task_from_args (char *args)
+get_task_from_args (const char *args)
 {
   task_t task;
   char *eptr;
@@ -132,7 +132,7 @@ get_task_from_args (char *args)
 }
 
 static void
-info_mach_task_command (char *args, int from_tty)
+info_mach_task_command (const char *args, int from_tty)
 {
   union
   {
@@ -189,7 +189,7 @@ info_mach_task_command (char *args, int from_tty)
 }
 
 static void
-info_mach_ports_command (char *args, int from_tty)
+info_mach_ports_command (const char *args, int from_tty)
 {
   port_name_array_t names;
   port_type_array_t types;
@@ -326,7 +326,7 @@ darwin_debug_port_info (task_t task, mach_port_t port)
 }
 
 static void
-info_mach_port_command (char *args, int from_tty)
+info_mach_port_command (const char *args, int from_tty)
 {
   task_t task;
   mach_port_t port;
@@ -338,7 +338,7 @@ info_mach_port_command (char *args, int from_tty)
 }
 
 static void
-info_mach_threads_command (char *args, int from_tty)
+info_mach_threads_command (const char *args, int from_tty)
 {
   thread_array_t threads;
   unsigned int thread_count;
@@ -365,7 +365,7 @@ info_mach_threads_command (char *args, int from_tty)
 }
 
 static void
-info_mach_thread_command (char *args, int from_tty)
+info_mach_thread_command (const char *args, int from_tty)
 {
   union
   {
@@ -696,7 +696,7 @@ darwin_debug_region (task_t task, mach_vm_address_t address)
 }
 
 static void
-info_mach_regions_command (char *args, int from_tty)
+info_mach_regions_command (const char *args, int from_tty)
 {
   task_t task;
 
@@ -708,7 +708,7 @@ info_mach_regions_command (char *args, int from_tty)
 }
 
 static void
-info_mach_regions_recurse_command (char *args, int from_tty)
+info_mach_regions_recurse_command (const char *args, int from_tty)
 {
   task_t task;
 
@@ -720,7 +720,7 @@ info_mach_regions_recurse_command (char *args, int from_tty)
 }
 
 static void
-info_mach_region_command (char *exp, int from_tty)
+info_mach_region_command (const char *exp, int from_tty)
 {
   struct value *val;
   mach_vm_address_t address;
@@ -792,7 +792,7 @@ disp_exception (const darwin_exception_info *info)
 }
 
 static void
-info_mach_exceptions_command (char *args, int from_tty)
+info_mach_exceptions_command (const char *args, int from_tty)
 {
   int i;
   task_t task;
index c8832fd36b5ba19479f92bf31787bc76ff061c67..e7b1e1440e95592d876a441abdd52bbd8f7b4329 100644 (file)
@@ -125,8 +125,6 @@ static int dcache_read_line (DCACHE *dcache, struct dcache_block *db);
 
 static struct dcache_block *dcache_alloc (DCACHE *dcache, CORE_ADDR addr);
 
-static void info_dcache_command (char *exp, int tty);
-
 static int dcache_enabled_p = 0; /* OBSOLETE */
 
 static void
@@ -585,7 +583,7 @@ dcache_print_line (DCACHE *dcache, int index)
 /* Parse EXP and show the info about DCACHE.  */
 
 static void
-dcache_info_1 (DCACHE *dcache, char *exp)
+dcache_info_1 (DCACHE *dcache, const char *exp)
 {
   splay_tree_node n;
   int i, refcount;
@@ -640,7 +638,7 @@ dcache_info_1 (DCACHE *dcache, char *exp)
 }
 
 static void
-info_dcache_command (char *exp, int tty)
+info_dcache_command (const char *exp, int tty)
 {
   dcache_info_1 (target_dcache_get (), exp);
 }
index 5bcab9d525f25a7f8a8da45d5e0f91b4f0efed85..c9ece0d5c044c2e167f19993810eb4a80f48a6a5 100644 (file)
@@ -34,7 +34,6 @@
 #include "block.h"
 #include "dictionary.h"
 
-static void info_common_command (char *, int);
 static void f77_get_dynamic_length_of_aggregate (struct type *);
 
 int f77_array_offset_tbl[MAX_FORTRAN_DIMS + 1][2];
@@ -433,7 +432,7 @@ info_common_command_for_block (const struct block *block, const char *comname,
    given name.  */
 
 static void
-info_common_command (char *comname, int from_tty)
+info_common_command (const char *comname, int from_tty)
 {
   struct frame_info *fi;
   const struct block *block;
index 7c24c3ac3c03c13cea61734f24789d24b36b28b3..0ed7a14d032aecee1d05f9d385fde0b5c85cd7cc 100644 (file)
@@ -786,9 +786,9 @@ extern void read_frame_arg (struct symbol *sym, struct frame_info *frame,
 extern void read_frame_local (struct symbol *sym, struct frame_info *frame,
                              struct frame_arg *argp);
 
-extern void info_args_command (char *, int);
+extern void info_args_command (const char *, int);
 
-extern void info_locals_command (char *, int);
+extern void info_locals_command (const char *, int);
 
 extern void return_command (const char *, int);
 
index 2ae20318f96563560a73c9fcfb42f9941d9569b7..609ba502a524f3cb47e25989b12e18ec4481e732 100644 (file)
@@ -3145,31 +3145,31 @@ info_port_rights (const char *args, mach_port_type_t only)
 }
 
 static void
-info_send_rights_cmd (char *args, int from_tty)
+info_send_rights_cmd (const char *args, int from_tty)
 {
   info_port_rights (args, MACH_PORT_TYPE_SEND);
 }
 
 static void
-info_recv_rights_cmd (char *args, int from_tty)
+info_recv_rights_cmd (const char *args, int from_tty)
 {
   info_port_rights (args, MACH_PORT_TYPE_RECEIVE);
 }
 
 static void
-info_port_sets_cmd (char *args, int from_tty)
+info_port_sets_cmd (const char *args, int from_tty)
 {
   info_port_rights (args, MACH_PORT_TYPE_PORT_SET);
 }
 
 static void
-info_dead_names_cmd (char *args, int from_tty)
+info_dead_names_cmd (const char *args, int from_tty)
 {
   info_port_rights (args, MACH_PORT_TYPE_DEAD_NAME);
 }
 
 static void
-info_port_rights_cmd (char *args, int from_tty)
+info_port_rights_cmd (const char *args, int from_tty)
 {
   info_port_rights (args, ~0);
 }
index 33244eed5f9e004067250516064c21319ed38cf2..07dbdfe2b3f1e8d1559e66f89b1d40ee7d7399b7 100644 (file)
 
 /* Local functions: */
 
-static void info_registers_command (char *, int);
-
 static void until_next_command (int);
 
-static void info_float_command (char *, int);
-
-static void info_program_command (char *, int);
-
 static void step_1 (int, int, const char *);
 
 #define ERROR_NO_INFERIOR \
@@ -2083,7 +2077,7 @@ finish_command (const char *arg, int from_tty)
 \f
 
 static void
-info_program_command (char *args, int from_tty)
+info_program_command (const char *args, int from_tty)
 {
   bpstat bs;
   int num, stat;
@@ -2416,7 +2410,7 @@ default_print_registers_info (struct gdbarch *gdbarch,
 }
 
 void
-registers_info (char *addr_exp, int fpregs)
+registers_info (const char *addr_exp, int fpregs)
 {
   struct frame_info *frame;
   struct gdbarch *gdbarch;
@@ -2435,7 +2429,7 @@ registers_info (char *addr_exp, int fpregs)
 
   while (*addr_exp != '\0')
     {
-      char *start;
+      const char *start;
       const char *end;
 
       /* Skip leading white space.  */
@@ -2524,13 +2518,13 @@ registers_info (char *addr_exp, int fpregs)
 }
 
 static void
-info_all_registers_command (char *addr_exp, int from_tty)
+info_all_registers_command (const char *addr_exp, int from_tty)
 {
   registers_info (addr_exp, 1);
 }
 
 static void
-info_registers_command (char *addr_exp, int from_tty)
+info_registers_command (const char *addr_exp, int from_tty)
 {
   registers_info (addr_exp, 0);
 }
@@ -2565,7 +2559,7 @@ print_vector_info (struct ui_file *file,
 }
 
 static void
-info_vector_command (char *args, int from_tty)
+info_vector_command (const char *args, int from_tty)
 {
   if (!target_has_registers)
     error (_("The program has no registers now."));
@@ -3106,7 +3100,7 @@ default_print_float_info (struct gdbarch *gdbarch, struct ui_file *file,
 }
 
 static void
-info_float_command (char *args, int from_tty)
+info_float_command (const char *args, int from_tty)
 {
   struct frame_info *frame;
 
index 0c60d30fa222b39de31724531c0d37e6ec9de02a..bcac98180a295a88bb021c53df2d1c73b0281c53 100644 (file)
@@ -529,7 +529,7 @@ print_selected_inferior (struct ui_out *uiout)
    printed.  */
 
 static void
-print_inferior (struct ui_out *uiout, char *requested_inferiors)
+print_inferior (struct ui_out *uiout, const char *requested_inferiors)
 {
   struct inferior *inf;
   int inf_count = 0;
@@ -718,7 +718,7 @@ inferior_command (const char *args, int from_tty)
 /* Print information about currently known inferiors.  */
 
 static void
-info_inferiors_command (char *args, int from_tty)
+info_inferiors_command (const char *args, int from_tty)
 {
   print_inferior (current_uiout, args);
 }
index f70c0accc53d4a7fe54d28cb058a650d6c36dce2..37252a695cd453685a93f1e1b64c1767e0349897 100644 (file)
@@ -160,7 +160,7 @@ extern void set_inferior_args (const char *);
 
 extern void set_inferior_args_vector (int, char **);
 
-extern void registers_info (char *, int);
+extern void registers_info (const char *, int);
 
 extern void continue_1 (int all_threads);
 
index 2fba0fa2a7edd728dc8b79fefde10b83cf412660..0c279e6a9f3f9bd8e9bf42f0d3d09c002a903f9e 100644 (file)
@@ -467,7 +467,7 @@ copy_terminal_info (struct inferior *to, struct inferior *from)
 }
 
 void
-info_terminal_command (char *arg, int from_tty)
+info_terminal_command (const char *arg, int from_tty)
 {
   target_terminal::info (arg, from_tty);
 }
index b041ff1199df65675867f9f322ce508304ef3135..4bf21c02e811067d4320461908bb66e539dee719 100644 (file)
@@ -70,8 +70,6 @@
 
 /* Prototypes for local functions */
 
-static void info_signals_command (char *, int);
-
 static void sig_print_info (enum gdb_signal);
 
 static void sig_print_header (void);
@@ -8679,7 +8677,7 @@ Use \"info signals\" for a list of symbolic signals."));
    targets, all signals should be in the signal tables).  */
 
 static void
-info_signals_command (char *signum_exp, int from_tty)
+info_signals_command (const char *signum_exp, int from_tty)
 {
   enum gdb_signal oursig;
 
index c60d90c3e51c3eb15cce33475e7ec30163775cbc..f55f743ed160a1e205db9509ca7d209f81a75487 100644 (file)
@@ -571,7 +571,7 @@ Please switch to another checkpoint before detaching the current one"));
 /* Print information about currently known checkpoints.  */
 
 static void
-info_checkpoints_command (char *arg, int from_tty)
+info_checkpoints_command (const char *arg, int from_tty)
 {
   struct gdbarch *gdbarch = get_current_arch ();
   struct symtab_and_line sal;
index 2bb8705fd6a89ffe080b52fb41b02d0b2e30f0d7..0ec8f822870229e4e80931580f087089d86b0a12 100644 (file)
@@ -188,19 +188,19 @@ print_macro_definition (const char *name,
 
 /* The implementation of the `info macro' command.  */
 static void
-info_macro_command (char *args, int from_tty)
+info_macro_command (const char *args, int from_tty)
 {
   struct macro_scope *ms = NULL;
   struct cleanup *cleanup_chain;
-  char *name;
+  const char *name;
   int show_all_macros_named = 0;
-  char *arg_start = args;
+  const char *arg_start = args;
   int processing_args = 1;
 
   while (processing_args
         && arg_start && *arg_start == '-' && *arg_start != '\0')
     {
-      char *p = skip_to_space (arg_start);
+      const char *p = skip_to_space (arg_start);
 
       if (strncmp (arg_start, "-a", p - arg_start) == 0
          || strncmp (arg_start, "-all", p - arg_start) == 0)
@@ -212,10 +212,9 @@ info_macro_command (char *args, int from_tty)
        processing_args = 0;
       else
        {
-         /* Relies on modified 'args' not making it in to history */
-         *p = '\0';
-         error (_("Unrecognized option '%s' to info macro command.  "
-                  "Try \"help info macro\"."), arg_start);
+         error (_("Unrecognized option '%.*s' to info macro command.  "
+                  "Try \"help info macro\"."),
+                int (p - arg_start), arg_start);
        }
 
         arg_start = skip_spaces (p);
@@ -270,7 +269,7 @@ info_macro_command (char *args, int from_tty)
 
 /* Implementation of the "info macros" command. */
 static void
-info_macros_command (char *args, int from_tty)
+info_macros_command (const char *args, int from_tty)
 {
   struct macro_scope *ms = NULL;
   struct cleanup *cleanup_chain = make_cleanup (free_current_contents, &ms);
index 04986646db88b5a7325ab1292c9aae3e797138e2..02b93e838b897b669cbdc17fb5a4830c67a3b135 100644 (file)
@@ -341,7 +341,7 @@ mem_command (const char *args, int from_tty)
 \f
 
 static void
-info_mem_command (char *args, int from_tty)
+info_mem_command (const char *args, int from_tty)
 {
   if (mem_use_target ())
     printf_filtered (_("Using memory regions provided by the target.\n"));
index eb74c71132221349213f61e15c7c13837fb4e0fe..1da1a98f93d3422b1ba27c23669c0fe4cdc09ec9 100644 (file)
@@ -359,7 +359,7 @@ do_closedir_cleanup (void *dir)
 }
 
 static void
-procfs_pidlist (char *args, int from_tty)
+procfs_pidlist (const char *args, int from_tty)
 {
   DIR *dp = NULL;
   struct dirent *dirp = NULL;
@@ -461,7 +461,7 @@ procfs_pidlist (char *args, int from_tty)
 }
 
 static void
-procfs_meminfo (char *args, int from_tty)
+procfs_meminfo (const char *args, int from_tty)
 {
   procfs_mapinfo *mapinfos = NULL;
   static int num_mapinfos = 0;
index 43abf13bc3e3a750f7de93ba7dad973333574daa..eb9da74e7c680375cc34f35b5f6a5f093084c7a2 100644 (file)
@@ -561,7 +561,7 @@ compare_selectors (const void *a, const void *b)
  */
 
 static void
-info_selectors_command (char *regexp, int from_tty)
+info_selectors_command (const char *regexp, int from_tty)
 {
   struct objfile       *objfile;
   struct minimal_symbol *msymbol;
@@ -723,7 +723,7 @@ compare_classes (const void *a, const void *b)
  */
 
 static void
-info_classes_command (char *regexp, int from_tty)
+info_classes_command (const char *regexp, int from_tty)
 {
   struct objfile       *objfile;
   struct minimal_symbol *msymbol;
index 276d22427a62a908fdf1650780150425ace95e8a..a8b106b2a794c347a4b58cfb0cbc1c4f4bfd94f4 100644 (file)
@@ -405,7 +405,7 @@ info_osdata (const char *type)
 }
 
 static void
-info_osdata_command (char *arg, int from_tty)
+info_osdata_command (const char *arg, int from_tty)
 {
   info_osdata (arg);
 }
index 48ff9038cf2e3fa5bb549d947ad0645246bccdf6..707b331919286c42a6552d51a815e15877f40b04 100644 (file)
@@ -1296,7 +1296,7 @@ set_command (const char *exp, int from_tty)
 }
 
 static void
-info_symbol_command (char *arg, int from_tty)
+info_symbol_command (const char *arg, int from_tty)
 {
   struct minimal_symbol *msymbol;
   struct objfile *objfile;
@@ -1387,7 +1387,7 @@ info_symbol_command (char *arg, int from_tty)
 }
 
 static void
-info_address_command (char *exp, int from_tty)
+info_address_command (const char *exp, int from_tty)
 {
   struct gdbarch *gdbarch;
   int regno;
@@ -2053,7 +2053,7 @@ disable_current_display (void)
 }
 
 static void
-info_display_command (char *ignore, int from_tty)
+info_display_command (const char *ignore, int from_tty)
 {
   struct display *d;
 
index 32cb7e92b7cd3746366974d80f2cc4b1e719176c..336955a6784af81844e9af78465a3b35673088f2 100644 (file)
@@ -52,7 +52,7 @@ gdbpy_auto_load_enabled (const struct extension_language_defn *extlang)
 /* Wrapper for "info auto-load python-scripts".  */
 
 static void
-info_auto_load_python_scripts (char *pattern, int from_tty)
+info_auto_load_python_scripts (const char *pattern, int from_tty)
 {
   auto_load_info_scripts (pattern, from_tty, &extension_language_python);
 }
index 28410a8788bd2bba1e4af8a3560afd32669d0a3d..7362f321e3615d5df265094b157cfe551038de4e 100644 (file)
@@ -305,7 +305,7 @@ bookmark_1 (int bnum)
 /* Implement "info bookmarks" command.  */
 
 static void
-info_bookmarks_command (char *args, int from_tty)
+info_bookmarks_command (const char *args, int from_tty)
 {
   if (!bookmark_chain)
     printf_filtered (_("No bookmarks.\n"));
index 6965f19a8053bcb777b361020722f6878b26a57b..4884092afcf09472f767c41b640b4502ad30480a 100644 (file)
@@ -887,7 +887,7 @@ gdb_pipe (int pdes[2])
 }
 
 static void
-info_serial_command (char *arg, int from_tty)
+info_serial_command (const char *arg, int from_tty)
 {
   struct dos_ttystate *port;
 #ifdef DOS_STATS
index af60eb74042bd7ffaf93ffb6f078e2576a6b8776..20fca784334f4113b2b298e8841e5966a456e020 100644 (file)
@@ -353,7 +353,7 @@ skip_command (const char *arg, int from_tty)
 }
 
 static void
-info_skip_command (char *arg, int from_tty)
+info_skip_command (const char *arg, int from_tty)
 {
   int num_printable_entries = 0;
   struct value_print_options opts;
index c70b9d8193319f0fbc7e95f9109e686fc7c1019a..b63bb9d4954267cc4ba409c78b8416b2cbde2a59 100644 (file)
@@ -1045,7 +1045,7 @@ solib_add (const char *pattern, int from_tty, int readsyms)
    all.  */
 
 static void
-info_sharedlibrary_command (char *pattern, int from_tty)
+info_sharedlibrary_command (const char *pattern, int from_tty)
 {
   struct so_list *so = NULL;   /* link map state variable */
   int so_missing_debug_info = 0;
index e67209e201081fb7c56d3b8c1630b02de5610ce7..cefc612f3e6a1e78c95975e555bb76599fe371da 100644 (file)
 
 static int get_filename_and_charpos (struct symtab *, char **);
 
-static void info_line_command (char *, int);
-
-static void info_source_command (char *, int);
-
 /* Path of directories to search for source files.
    Same format as the PATH environment variable's value.  */
 
@@ -639,7 +635,7 @@ add_path (const char *dirname, char **which_path, int parse_separators)
 
 
 static void
-info_source_command (char *ignore, int from_tty)
+info_source_command (const char *ignore, int from_tty)
 {
   struct symtab *s = current_source_symtab;
   struct compunit_symtab *cust;
@@ -1480,7 +1476,7 @@ print_source_lines (struct symtab *s, int line, int stopline,
 /* Print info on range of pc's in a specified line.  */
 
 static void
-info_line_command (char *arg, int from_tty)
+info_line_command (const char *arg, int from_tty)
 {
   CORE_ADDR start_pc, end_pc;
 
index 592f0265b4c55f96f4bda0859788d0bf21a0dd2f..81032fc895cec327976925434c5c1c540f0539fe 100644 (file)
@@ -1380,7 +1380,7 @@ parse_frame_specification (const char *frame_exp, int *selected_frame_p)
    ADDR_EXP.  Absolutely all information in the frame is printed.  */
 
 static void
-info_frame_command (char *addr_exp, int from_tty)
+info_frame_command (const char *addr_exp, int from_tty)
 {
   struct frame_info *fi;
   struct symbol *func;
@@ -1903,14 +1903,6 @@ backtrace_command (const char *arg, int from_tty)
                       no_filters >= 0 /* no frame-filters */, from_tty);
 }
 
-/* Temporary non-const overload.  */
-
-static void
-backtrace_command (char *arg, int from_tty)
-{
-  backtrace_command ((const char *) arg, from_tty);
-}
-
 /* Iterate over the local variables of a block B, calling CB with
    CB_DATA.  */
 
@@ -2114,7 +2106,7 @@ print_frame_local_vars (struct frame_info *frame, int num_tabs,
 }
 
 void
-info_locals_command (char *args, int from_tty)
+info_locals_command (const char *args, int from_tty)
 {
   print_frame_local_vars (get_selected_frame (_("No frame selected.")),
                          0, gdb_stdout);
@@ -2196,7 +2188,7 @@ print_frame_arg_vars (struct frame_info *frame, struct ui_file *stream)
 }
 
 void
-info_args_command (char *ignore, int from_tty)
+info_args_command (const char *ignore, int from_tty)
 {
   print_frame_arg_vars (get_selected_frame (_("No frame selected.")),
                        gdb_stdout);
index 9afd9943d9cb9ca9cdb7bc7cb33922b1bd2c8f86..8cc76e364599042adeba654a96b6d00c4e908226 100644 (file)
@@ -102,8 +102,6 @@ static int simple_read_overlay_table (void);
 
 static int simple_overlay_update_1 (struct obj_section *);
 
-static void info_ext_lang_command (char *args, int from_tty);
-
 static void symfile_find_segment_sections (struct objfile *objfile);
 
 /* List of all available sym_fns.  On gdb startup, each object file reader
@@ -2723,7 +2721,7 @@ set_ext_lang_command (char *args, int from_tty, struct cmd_list_element *e)
 }
 
 static void
-info_ext_lang_command (char *args, int from_tty)
+info_ext_lang_command (const char *args, int from_tty)
 {
   printf_filtered (_("Filename extensions and the languages they represent:"));
   printf_filtered ("\n\n");
index d02b707c52aff5d1515c3466be69b6bc6b1f6057..1df980ab65a7f741d8af3f2ab8aea981f9649e61 100644 (file)
@@ -4033,7 +4033,7 @@ output_partial_symbol_filename (const char *filename, const char *fullname,
 }
 
 static void
-info_sources_command (char *ignore, int from_tty)
+info_sources_command (const char *ignore, int from_tty)
 {
   struct compunit_symtab *cu;
   struct symtab *s;
@@ -4485,23 +4485,15 @@ info_variables_command (const char *regexp, int from_tty)
   symtab_symbol_info (regexp, VARIABLES_DOMAIN, from_tty);
 }
 
-/* Temporary non-const overload.  */
-
-static void
-info_variables_command (char *regexp, int from_tty)
-{
-  symtab_symbol_info (regexp, VARIABLES_DOMAIN, from_tty);
-}
-
 static void
-info_functions_command (char *regexp, int from_tty)
+info_functions_command (const char *regexp, int from_tty)
 {
   symtab_symbol_info (regexp, FUNCTIONS_DOMAIN, from_tty);
 }
 
 
 static void
-info_types_command (char *regexp, int from_tty)
+info_types_command (const char *regexp, int from_tty)
 {
   symtab_symbol_info (regexp, TYPES_DOMAIN, from_tty);
 }
index 93bb6e93c76a4e882457aab592caa5b97c52697d..5c612d141341a40e86f66b12a960c026d2f20a49 100644 (file)
@@ -48,8 +48,6 @@
 #include <algorithm>
 #include "byte-vector.h"
 
-static void info_target_command (char *, int);
-
 static void generic_tls_error (void) ATTRIBUTE_NORETURN;
 
 static void default_terminal_info (struct target_ops *, const char *, int);
@@ -2019,7 +2017,7 @@ target_remove_breakpoint (struct gdbarch *gdbarch,
 }
 
 static void
-info_target_command (char *args, int from_tty)
+info_target_command (const char *args, int from_tty)
 {
   struct target_ops *t;
   int has_all_mem = 0;
index f6140979265b13e29fad0ec92d34927873b32256..7309302b6b6be107b11e18a7611f30f7db98949d 100644 (file)
@@ -62,7 +62,6 @@ static int threads_executing;
 
 static void thread_apply_all_command (char *, int);
 static int thread_alive (struct thread_info *);
-static void info_threads_command (char *, int);
 
 /* RAII type used to increase / decrease the refcount of each thread
    in a given list of threads.  */
@@ -1197,7 +1196,7 @@ should_print_thread (const char *requested_threads, int default_inf_num,
    thread ids.  */
 
 static void
-print_thread_info_1 (struct ui_out *uiout, char *requested_threads,
+print_thread_info_1 (struct ui_out *uiout, const char *requested_threads,
                     int global_ids, int pid,
                     int show_global_ids)
 {
@@ -1384,7 +1383,7 @@ print_thread_info (struct ui_out *uiout, char *requested_threads, int pid)
         effects info-threads command would be nicer.  */
 
 static void
-info_threads_command (char *arg, int from_tty)
+info_threads_command (const char *arg, int from_tty)
 {
   int show_global_ids = 0;
 
index 3cae62065a1eae913281dcaec70d0c528ceb49c3..f7e35da0829c4e186a49523feeea874a2b3957a7 100644 (file)
@@ -492,7 +492,7 @@ tvariables_info_1 (void)
 /* List all the trace state variables.  */
 
 static void
-info_tvariables_command (char *args, int from_tty)
+info_tvariables_command (const char *args, int from_tty)
 {
   tvariables_info_1 ();
 }
@@ -2514,7 +2514,7 @@ tfind_outside_command (const char *args, int from_tty)
 
 /* info scope command: list the locals for a scope.  */
 static void
-info_scope_command (char *args_in, int from_tty)
+info_scope_command (const char *args_in, int from_tty)
 {
   struct symbol *sym;
   struct bound_minimal_symbol msym;
@@ -3874,7 +3874,7 @@ print_one_static_tracepoint_marker (int count,
 }
 
 static void
-info_static_tracepoint_markers_command (char *arg, int from_tty)
+info_static_tracepoint_markers_command (const char *arg, int from_tty)
 {
   VEC(static_tracepoint_marker_p) *markers;
   struct cleanup *old_chain;
index 9482646c95fcd7428338fc168253e77c75514f99..685cf0621e0ce20814be9675738c1f818d33e5be 100644 (file)
@@ -64,7 +64,7 @@ static int new_height_ok (struct tui_win_info *, int);
 static void tui_set_tab_width_command (const char *, int);
 static void tui_refresh_all_command (const char *, int);
 static void tui_set_win_height_command (const char *, int);
-static void tui_all_windows_info (char *, int);
+static void tui_all_windows_info (const char *, int);
 static void tui_set_focus_command (const char *, int);
 static void tui_scroll_forward_command (const char *, int);
 static void tui_scroll_backward_command (const char *, int);
@@ -1087,7 +1087,7 @@ tui_set_focus_command (const char *arg, int from_tty)
 
 
 static void
-tui_all_windows_info (char *arg, int from_tty)
+tui_all_windows_info (const char *arg, int from_tty)
 {
   int type;
   struct tui_win_info *win_with_focus = tui_win_with_focus ();
This page took 0.057026 seconds and 4 git commands to generate.