Constify add_prefix_cmd
authorTom Tromey <tom@tromey.com>
Tue, 26 Sep 2017 04:28:30 +0000 (22:28 -0600)
committerTom Tromey <tom@tromey.com>
Wed, 11 Oct 2017 22:21:02 +0000 (16:21 -0600)
This changes add_prefix_cmd to accept a const-taking function as an
argument; then fixes up all the callers.

In a couple of spots I had to add a non-const overload of a function,
because the function is passed to two different command-adding
"constructors".  These overloads are temporary; once constification is
complete they can be removed.

This patch also fixes a typo I happened to notice while constifying.

Note that this touches a couple of files (gnu-nat.c and go32-nat.c)
that I can't build.  So, while I made a best-effort there, I am not
certain they will still compile.

Tested by rebuilding.

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

* gdbthread.h (thread_command): Constify.
* inferior.h (detach_command): Constify.
* top.h (set_history, show_history): Constify.
* arm-tdep.c (set_arm_command, show_arm_command): Constify.
* serial.c (serial_set_cmd, serial_show_cmd): Constify.
* bsd-kvm.c (bsd_kvm_cmd): Constify.
* printcmd.c (set_command): Constify.
(non_const_set_command): New function.
* dcache.c (set_dcache_command, show_dcache_command): Constify.
* breakpoint.c (enable_command, disable_command, delete_command)
(catch_command, tcatch_command, set_breakpoint_cmd)
(show_breakpoint_cmd): Constify.
* macrocmd.c (macro_command): Constify.
* infcmd.c (unset_command, kill_command, detach_command)
(info_proc_cmd): Constify.
* i386-tdep.c (set_mpx_cmd, show_mpx_cmd): Constify.
* auto-load.c (show_auto_load_cmd, set_auto_load_cmd)
(info_auto_load_cmd): Constify.
* target-descriptions.c (set_tdesc_cmd, show_tdesc_cmd)
(unset_tdesc_cmd): Constify.
* ada-lang.c (set_ada_command, show_ada_command)
(maint_set_ada_cmd, maint_show_ada_cmd): Constify.
* guile/guile.c (set_guile_command, show_guile_command)
(info_guile_command): Constify.
* tui/tui-win.c (tui_command, set_tui_cmd, show_tui_cmd):
Constify.
* skip.c (skip_command): Constify.
* compile/compile.c (_initialize_compile): Constify.
* dwarf2read.c (set_dwarf_cmd, show_dwarf_cmd): Constify.
* btrace.c (maint_btrace_cmd, maint_btrace_set_cmd)
(maint_btrace_show_cmd, maint_btrace_pt_set_cmd)
(maint_btrace_pt_show_cmd): Constify.
* remote.c (set_remote_cmd, show_remote_cmd, remote_command):
Constify.
* python/python.c (user_show_python, user_set_python): Constify.
* mips-tdep.c (set_mips_command, show_mips_command)
(set_mipsfpu_command): Constify.
* record-btrace.c (cmd_record_btrace_start)
(cmd_set_record_btrace, cmd_show_record_btrace)
(cmd_set_record_btrace_bts, cmd_show_record_btrace_bts)
(cmd_set_record_btrace_pt, cmd_show_record_btrace_pt): Constify.
* rs6000-tdep.c (set_powerpc_command, show_powerpc_command):
Constify.
* symfile.c (overlay_command): Constify.
* spu-tdep.c (set_spu_command, show_spu_command): Constify.
* cli/cli-logging.c (set_logging_command, show_logging_command):
Constify.
* cli/cli-dump.c (dump_command, append_command)
(srec_dump_command, ihex_dump_command, verilog_dump_command)
(tekhex_dump_command, binary_dump_command)
(binary_append_command): Constify.
* cli/cli-decode.c (struct cmd_list_element): Change type of
"fun".
* cli/cli-cmds.c (info_command, show_command, set_debug)
(show_debug): Constify.
(show_command): Add non-const overload.
* top.c (set_history, show_history): Constify.
* sh-tdep.c (set_sh_command, show_sh_command): Constify.
* command.h (add_prefix_cmd): Accept a cmd_const_cfunc_ftype.
* target.c (target_command): Constify.
* sparc64-tdep.c (info_adi_command): Constify.
* record-full.c (cmd_record_full_start): Constify.
(set_record_full_command): Constify.  Fix typo.
(show_record_full_command): Constify.
* thread.c (thread_command, thread_apply_command): Constify.
* memattr.c (dummy_cmd): Constify.
* value.c (function_command): Constify.
* frame.c (set_backtrace_cmd, show_backtrace_cmd): Constify.
* probe.c (info_probes_command): Constify.
* ser-tcp.c (set_tcp_cmd, show_tcp_cmd): Constify.
* gnu-nat.c (set_task_cmd, show_task_cmd, set_thread_cmd)
(show_thread_cmd, set_thread_default_cmd)
(show_thread_default_cmd): Constify.
(check_empty): Constify.
* tracepoint.c (tfind_command): Constify.
* cp-support.c (maint_cplus_command): Constify.
* windows-tdep.c (info_w32_command): Constify.
* record.c (cmd_record_start, set_record_command)
(show_record_command, info_record_command, cmd_record_goto):
Constify.
* ravenscar-thread.c (set_ravenscar_command)
(show_ravenscar_command): Constify.
* utils.c (set_internal_problem_cmd, show_internal_problem_cmd):
Constify.
(add_internal_problem_command): Remove casts.
* arc-tdep.c (maintenance_print_arc_command): Constify.
* valprint.c (set_print, show_print, set_print_raw)
(show_print_raw): Constify.
* maint.c (maintenance_command, maintenance_info_command)
(maintenance_print_command, maintenance_set_cmd)
(maintenance_show_cmd, set_per_command_cmd)
(show_per_command_cmd, maintenance_check_command): Constify.
* language.c (set_check, show_check): Constify.
* typeprint.c (show_print_type, set_print_type): Constify.
* go32-nat.c (go32_info_dos_command): Constify.

58 files changed:
gdb/ChangeLog
gdb/ada-lang.c
gdb/arc-tdep.c
gdb/arm-tdep.c
gdb/auto-load.c
gdb/breakpoint.c
gdb/bsd-kvm.c
gdb/btrace.c
gdb/cli/cli-cmds.c
gdb/cli/cli-decode.c
gdb/cli/cli-dump.c
gdb/cli/cli-logging.c
gdb/command.h
gdb/compile/compile.c
gdb/cp-support.c
gdb/dcache.c
gdb/dwarf2read.c
gdb/frame.c
gdb/gdbthread.h
gdb/gnu-nat.c
gdb/go32-nat.c
gdb/guile/guile.c
gdb/i386-tdep.c
gdb/infcmd.c
gdb/inferior.h
gdb/language.c
gdb/macrocmd.c
gdb/maint.c
gdb/memattr.c
gdb/mips-tdep.c
gdb/printcmd.c
gdb/probe.c
gdb/python/python.c
gdb/ravenscar-thread.c
gdb/record-btrace.c
gdb/record-full.c
gdb/record.c
gdb/remote.c
gdb/rs6000-tdep.c
gdb/ser-tcp.c
gdb/serial.c
gdb/sh-tdep.c
gdb/skip.c
gdb/sparc64-tdep.c
gdb/spu-tdep.c
gdb/symfile.c
gdb/target-descriptions.c
gdb/target.c
gdb/thread.c
gdb/top.c
gdb/top.h
gdb/tracepoint.c
gdb/tui/tui-win.c
gdb/typeprint.c
gdb/utils.c
gdb/valprint.c
gdb/value.c
gdb/windows-tdep.c

index 6fbe88b569f0b976b232c68be9968a6bd2c12209..60be796404abda84925765a00d6047ba85b1d129 100644 (file)
@@ -1,3 +1,101 @@
+2017-10-11  Tom Tromey  <tom@tromey.com>
+
+       * gdbthread.h (thread_command): Constify.
+       * inferior.h (detach_command): Constify.
+       * top.h (set_history, show_history): Constify.
+       * arm-tdep.c (set_arm_command, show_arm_command): Constify.
+       * serial.c (serial_set_cmd, serial_show_cmd): Constify.
+       * bsd-kvm.c (bsd_kvm_cmd): Constify.
+       * printcmd.c (set_command): Constify.
+       (non_const_set_command): New function.
+       * dcache.c (set_dcache_command, show_dcache_command): Constify.
+       * breakpoint.c (enable_command, disable_command, delete_command)
+       (catch_command, tcatch_command, set_breakpoint_cmd)
+       (show_breakpoint_cmd): Constify.
+       * macrocmd.c (macro_command): Constify.
+       * infcmd.c (unset_command, kill_command, detach_command)
+       (info_proc_cmd): Constify.
+       * i386-tdep.c (set_mpx_cmd, show_mpx_cmd): Constify.
+       * auto-load.c (show_auto_load_cmd, set_auto_load_cmd)
+       (info_auto_load_cmd): Constify.
+       * target-descriptions.c (set_tdesc_cmd, show_tdesc_cmd)
+       (unset_tdesc_cmd): Constify.
+       * ada-lang.c (set_ada_command, show_ada_command)
+       (maint_set_ada_cmd, maint_show_ada_cmd): Constify.
+       * guile/guile.c (set_guile_command, show_guile_command)
+       (info_guile_command): Constify.
+       * tui/tui-win.c (tui_command, set_tui_cmd, show_tui_cmd):
+       Constify.
+       * skip.c (skip_command): Constify.
+       * compile/compile.c (_initialize_compile): Constify.
+       * dwarf2read.c (set_dwarf_cmd, show_dwarf_cmd): Constify.
+       * btrace.c (maint_btrace_cmd, maint_btrace_set_cmd)
+       (maint_btrace_show_cmd, maint_btrace_pt_set_cmd)
+       (maint_btrace_pt_show_cmd): Constify.
+       * remote.c (set_remote_cmd, show_remote_cmd, remote_command):
+       Constify.
+       * python/python.c (user_show_python, user_set_python): Constify.
+       * mips-tdep.c (set_mips_command, show_mips_command)
+       (set_mipsfpu_command): Constify.
+       * record-btrace.c (cmd_record_btrace_start)
+       (cmd_set_record_btrace, cmd_show_record_btrace)
+       (cmd_set_record_btrace_bts, cmd_show_record_btrace_bts)
+       (cmd_set_record_btrace_pt, cmd_show_record_btrace_pt): Constify.
+       * rs6000-tdep.c (set_powerpc_command, show_powerpc_command):
+       Constify.
+       * symfile.c (overlay_command): Constify.
+       * spu-tdep.c (set_spu_command, show_spu_command): Constify.
+       * cli/cli-logging.c (set_logging_command, show_logging_command):
+       Constify.
+       * cli/cli-dump.c (dump_command, append_command)
+       (srec_dump_command, ihex_dump_command, verilog_dump_command)
+       (tekhex_dump_command, binary_dump_command)
+       (binary_append_command): Constify.
+       * cli/cli-decode.c (struct cmd_list_element): Change type of
+       "fun".
+       * cli/cli-cmds.c (info_command, show_command, set_debug)
+       (show_debug): Constify.
+       (show_command): Add non-const overload.
+       * top.c (set_history, show_history): Constify.
+       * sh-tdep.c (set_sh_command, show_sh_command): Constify.
+       * command.h (add_prefix_cmd): Accept a cmd_const_cfunc_ftype.
+       * target.c (target_command): Constify.
+       * sparc64-tdep.c (info_adi_command): Constify.
+       * record-full.c (cmd_record_full_start): Constify.
+       (set_record_full_command): Constify.  Fix typo.
+       (show_record_full_command): Constify.
+       * thread.c (thread_command, thread_apply_command): Constify.
+       * memattr.c (dummy_cmd): Constify.
+       * value.c (function_command): Constify.
+       * frame.c (set_backtrace_cmd, show_backtrace_cmd): Constify.
+       * probe.c (info_probes_command): Constify.
+       * ser-tcp.c (set_tcp_cmd, show_tcp_cmd): Constify.
+       * gnu-nat.c (set_task_cmd, show_task_cmd, set_thread_cmd)
+       (show_thread_cmd, set_thread_default_cmd)
+       (show_thread_default_cmd): Constify.
+       (check_empty): Constify.
+       * tracepoint.c (tfind_command): Constify.
+       * cp-support.c (maint_cplus_command): Constify.
+       * windows-tdep.c (info_w32_command): Constify.
+       * record.c (cmd_record_start, set_record_command)
+       (show_record_command, info_record_command, cmd_record_goto):
+       Constify.
+       * ravenscar-thread.c (set_ravenscar_command)
+       (show_ravenscar_command): Constify.
+       * utils.c (set_internal_problem_cmd, show_internal_problem_cmd):
+       Constify.
+       (add_internal_problem_command): Remove casts.
+       * arc-tdep.c (maintenance_print_arc_command): Constify.
+       * valprint.c (set_print, show_print, set_print_raw)
+       (show_print_raw): Constify.
+       * maint.c (maintenance_command, maintenance_info_command)
+       (maintenance_print_command, maintenance_set_cmd)
+       (maintenance_show_cmd, set_per_command_cmd)
+       (show_per_command_cmd, maintenance_check_command): Constify.
+       * language.c (set_check, show_check): Constify.
+       * typeprint.c (show_print_type, set_print_type): Constify.
+       * go32-nat.c (go32_info_dos_command): Constify.
+
 2017-10-11  Tom Tromey  <tom@tromey.com>
 
        * breakpoint.c (prepare_re_set_context): Remove.
index 1a0c76959481c6f075694a12bc50d67f5b699fa3..7409496ce7a24b0007dff23ed2fbebc619c6a99c 100644 (file)
@@ -352,7 +352,7 @@ static struct cmd_list_element *maint_show_ada_cmdlist;
 /* Implement the "maintenance set ada" (prefix) command.  */
 
 static void
-maint_set_ada_cmd (char *args, int from_tty)
+maint_set_ada_cmd (const char *args, int from_tty)
 {
   help_list (maint_set_ada_cmdlist, "maintenance set ada ", all_commands,
             gdb_stdout);
@@ -361,7 +361,7 @@ maint_set_ada_cmd (char *args, int from_tty)
 /* Implement the "maintenance show ada" (prefix) command.  */
 
 static void
-maint_show_ada_cmd (char *args, int from_tty)
+maint_show_ada_cmd (const char *args, int from_tty)
 {
   cmd_show_list (maint_show_ada_cmdlist, from_tty, "");
 }
@@ -13969,7 +13969,7 @@ static struct cmd_list_element *show_ada_list;
 /* Implement the "set ada" prefix command.  */
 
 static void
-set_ada_command (char *arg, int from_tty)
+set_ada_command (const char *arg, int from_tty)
 {
   printf_unfiltered (_(\
 "\"set ada\" must be followed by the name of a setting.\n"));
@@ -13979,7 +13979,7 @@ set_ada_command (char *arg, int from_tty)
 /* Implement the "show ada" prefix command.  */
 
 static void
-show_ada_command (char *args, int from_tty)
+show_ada_command (const char *args, int from_tty)
 {
   cmd_show_list (show_ada_list, from_tty, "");
 }
index 771d6dfaff3820b2897ba704806442f908393442..6ff6ba38f954a3810370529f7d797777a4022e84 100644 (file)
@@ -2140,7 +2140,7 @@ arc_dump_tdep (struct gdbarch *gdbarch, struct ui_file *file)
 /* Wrapper for "maintenance print arc" list of commands.  */
 
 static void
-maintenance_print_arc_command (char *args, int from_tty)
+maintenance_print_arc_command (const char *args, int from_tty)
 {
   cmd_show_list (maintenance_print_arc_list, from_tty, "");
 }
index d8569e051aca6574b0d3932b2869e629b9454371..f760b618ecff9f277cb963fcbf30f027e67b16c7 100644 (file)
@@ -8365,7 +8365,7 @@ arm_skip_stub (struct frame_info *frame, CORE_ADDR pc)
 }
 
 static void
-set_arm_command (char *args, int from_tty)
+set_arm_command (const char *args, int from_tty)
 {
   printf_unfiltered (_("\
 \"set arm\" must be followed by an apporpriate subcommand.\n"));
@@ -8373,7 +8373,7 @@ set_arm_command (char *args, int from_tty)
 }
 
 static void
-show_arm_command (char *args, int from_tty)
+show_arm_command (const char *args, int from_tty)
 {
   cmd_show_list (showarmcmdlist, from_tty, "");
 }
index ddd060182f6b4143c105eec3838d7450916015ae..9b1111d066d8826c7e5f9424459f2cea52a3d66a 100644 (file)
@@ -1451,7 +1451,7 @@ Use `info auto-load %s-scripts [REGEXP]' to list them."),
 /* The only valid "set auto-load" argument is off|0|no|disable.  */
 
 static void
-set_auto_load_cmd (char *args, int from_tty)
+set_auto_load_cmd (const char *args, int from_tty)
 {
   struct cmd_list_element *list;
   size_t length;
@@ -1500,7 +1500,7 @@ automatic loading of Python scripts."),
    "show auto-load " settings.  */
 
 static void
-show_auto_load_cmd (char *args, int from_tty)
+show_auto_load_cmd (const char *args, int from_tty)
 {
   cmd_show_list (*auto_load_show_cmdlist_get (), from_tty, "");
 }
@@ -1528,7 +1528,7 @@ automatic loading of Python scripts."),
    newlines at proper places.  */
 
 static void
-info_auto_load_cmd (char *args, int from_tty)
+info_auto_load_cmd (const char *args, int from_tty)
 {
   struct cmd_list_element *list;
   struct cleanup *infolist_chain;
index 6e9c7b7fea56a23788c6f567e540990b324aa5f3..32ceea7c9b665b5a7ef090c5fe5ba64285210e67 100644 (file)
@@ -93,10 +93,6 @@ enum exception_event_kind
 
 /* Prototypes for local functions.  */
 
-static void disable_command (char *, int);
-
-static void enable_command (char *, int);
-
 static void map_breakpoint_numbers (const char *,
                                    gdb::function_view<void (breakpoint *)>);
 
@@ -125,8 +121,6 @@ static std::vector<symtab_and_line> decode_location_default
 
 static void clear_command (char *, int);
 
-static void catch_command (char *, int);
-
 static int can_use_hardware_watchpoint (struct value *);
 
 static void mention (struct breakpoint *);
@@ -201,8 +195,6 @@ static void enable_breakpoint_disp (struct breakpoint *, enum bpdisp,
 
 static void stop_command (char *arg, int from_tty);
 
-static void tcatch_command (char *arg, int from_tty);
-
 static void free_bp_location (struct bp_location *loc);
 static void incref_bp_location (struct bp_location *loc);
 static void decref_bp_location (struct bp_location **loc);
@@ -11496,14 +11488,14 @@ init_ada_exception_breakpoint (struct breakpoint *b,
 }
 
 static void
-catch_command (char *arg, int from_tty)
+catch_command (const char *arg, int from_tty)
 {
   error (_("Catch requires an event name."));
 }
 \f
 
 static void
-tcatch_command (char *arg, int from_tty)
+tcatch_command (const char *arg, int from_tty)
 {
   error (_("Catch requires an event name."));
 }
@@ -13439,7 +13431,7 @@ iterate_over_related_breakpoints (struct breakpoint *b,
 }
 
 static void
-delete_command (char *arg, int from_tty)
+delete_command (const char *arg, int from_tty)
 {
   struct breakpoint *b, *b_tmp;
 
@@ -14283,7 +14275,7 @@ disable_breakpoint (struct breakpoint *bpt)
 }
 
 static void
-disable_command (char *args, int from_tty)
+disable_command (const char *args, int from_tty)
 {
   if (args == 0)
     {
@@ -14403,7 +14395,7 @@ enable_breakpoint (struct breakpoint *bpt)
    in stopping the inferior.  */
 
 static void
-enable_command (char *args, int from_tty)
+enable_command (const char *args, int from_tty)
 {
   if (args == 0)
     {
@@ -14498,12 +14490,12 @@ enable_delete_command (const char *args, int from_tty)
 }
 \f
 static void
-set_breakpoint_cmd (char *args, int from_tty)
+set_breakpoint_cmd (const char *args, int from_tty)
 {
 }
 
 static void
-show_breakpoint_cmd (char *args, int from_tty)
+show_breakpoint_cmd (const char *args, int from_tty)
 {
 }
 
@@ -15282,7 +15274,7 @@ add_catch_command (const char *name, const char *docstring,
 }
 
 static void
-save_command (char *arg, int from_tty)
+save_command (const char *arg, int from_tty)
 {
   printf_unfiltered (_("\"save\" must be followed by "
                       "the name of a save subcommand.\n"));
index 04e5622db8f83b3100ed6181c59b989146648037..3d013b4e1d267f06bdbfbfd1a2f3508099373fa4 100644 (file)
@@ -271,7 +271,7 @@ bsd_kvm_fetch_registers (struct target_ops *ops,
 struct cmd_list_element *bsd_kvm_cmdlist;
 
 static void
-bsd_kvm_cmd (char *arg, int fromtty)
+bsd_kvm_cmd (const char *arg, int fromtty)
 {
   /* ??? Should this become an alias for "target kvm"?  */
 }
index 7990d5f8863ed5d9a8c482ccf9a034937f0a0100..8338ebfb0a2edf674897cc88a808a517c19eb367 100644 (file)
@@ -3374,7 +3374,7 @@ maint_btrace_clear_cmd (const char *args, int from_tty)
 /* The "maintenance btrace" command.  */
 
 static void
-maint_btrace_cmd (char *args, int from_tty)
+maint_btrace_cmd (const char *args, int from_tty)
 {
   help_list (maint_btrace_cmdlist, "maintenance btrace ", all_commands,
             gdb_stdout);
@@ -3383,7 +3383,7 @@ maint_btrace_cmd (char *args, int from_tty)
 /* The "maintenance set btrace" command.  */
 
 static void
-maint_btrace_set_cmd (char *args, int from_tty)
+maint_btrace_set_cmd (const char *args, int from_tty)
 {
   help_list (maint_btrace_set_cmdlist, "maintenance set btrace ", all_commands,
             gdb_stdout);
@@ -3392,7 +3392,7 @@ maint_btrace_set_cmd (char *args, int from_tty)
 /* The "maintenance show btrace" command.  */
 
 static void
-maint_btrace_show_cmd (char *args, int from_tty)
+maint_btrace_show_cmd (const char *args, int from_tty)
 {
   help_list (maint_btrace_show_cmdlist, "maintenance show btrace ",
             all_commands, gdb_stdout);
@@ -3401,7 +3401,7 @@ maint_btrace_show_cmd (char *args, int from_tty)
 /* The "maintenance set btrace pt" command.  */
 
 static void
-maint_btrace_pt_set_cmd (char *args, int from_tty)
+maint_btrace_pt_set_cmd (const char *args, int from_tty)
 {
   help_list (maint_btrace_pt_set_cmdlist, "maintenance set btrace pt ",
             all_commands, gdb_stdout);
@@ -3410,7 +3410,7 @@ maint_btrace_pt_set_cmd (char *args, int from_tty)
 /* The "maintenance show btrace pt" command.  */
 
 static void
-maint_btrace_pt_show_cmd (char *args, int from_tty)
+maint_btrace_pt_show_cmd (const char *args, int from_tty)
 {
   help_list (maint_btrace_pt_show_cmdlist, "maintenance show btrace pt ",
             all_commands, gdb_stdout);
index 51271adffe210b2e99da89e65258663483647dde..a1c308a38d202e239f81941bb5ab9911ef162dea 100644 (file)
@@ -68,14 +68,6 @@ static void pwd_command (char *, int);
 
 static void help_command (char *, int);
 
-static void show_command (char *, int);
-
-static void info_command (char *, int);
-
-static void show_debug (char *, int);
-
-static void set_debug (char *, int);
-
 static void make_command (char *, int);
 
 static void shell_escape (const char *, int);
@@ -218,7 +210,7 @@ error_no_arg (const char *why)
    args.  */
 
 static void
-info_command (char *arg, int from_tty)
+info_command (const char *arg, int from_tty)
 {
   printf_unfiltered (_("\"info\" must be followed by "
                       "the name of an info command.\n"));
@@ -227,11 +219,20 @@ info_command (char *arg, int from_tty)
 
 /* The "show" command with no arguments shows all the settings.  */
 
+static void
+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.  */
@@ -1616,7 +1617,7 @@ filter_sals (std::vector<symtab_and_line> &sals)
 }
 
 static void
-set_debug (char *arg, int from_tty)
+set_debug (const char *arg, int from_tty)
 {
   printf_unfiltered (_("\"set debug\" must be followed by "
                       "the name of a debug subcommand.\n"));
@@ -1624,7 +1625,7 @@ set_debug (char *arg, int from_tty)
 }
 
 static void
-show_debug (char *args, int from_tty)
+show_debug (const char *args, int from_tty)
 {
   cmd_show_list (showdebuglist, from_tty, "");
 }
index f161c86ebc8c418e91647987ad52378ec5bcff59..87ebed5f6e2769ee4fae3ffa1181bf60f6403534 100644 (file)
@@ -396,7 +396,7 @@ add_alias_cmd (const char *name, const char *oldname,
 
 struct cmd_list_element *
 add_prefix_cmd (const char *name, enum command_class theclass,
-               cmd_cfunc_ftype *fun,
+               cmd_const_cfunc_ftype *fun,
                const char *doc, struct cmd_list_element **prefixlist,
                const char *prefixname, int allow_unknown,
                struct cmd_list_element **list)
index f4ea2d7342bef7828efc9c157b61b979c2dcb209..4eafffac908c4059408f2fd8b2f185c8122b5642 100644 (file)
@@ -129,14 +129,14 @@ static struct cmd_list_element *binary_dump_cmdlist;
 static struct cmd_list_element *binary_append_cmdlist;
 
 static void
-dump_command (char *cmd, int from_tty)
+dump_command (const char *cmd, int from_tty)
 {
   printf_unfiltered (_("\"dump\" must be followed by a subcommand.\n\n"));
   help_list (dump_cmdlist, "dump ", all_commands, gdb_stdout);
 }
 
 static void
-append_command (char *cmd, int from_tty)
+append_command (const char *cmd, int from_tty)
 {
   printf_unfiltered (_("\"append\" must be followed by a subcommand.\n\n"));
   help_list (dump_cmdlist, "append ", all_commands, gdb_stdout);
@@ -581,42 +581,42 @@ restore_command (char *args_in, int from_tty)
 }
 
 static void
-srec_dump_command (char *cmd, int from_tty)
+srec_dump_command (const char *cmd, int from_tty)
 {
   printf_unfiltered (_("\"dump srec\" must be followed by a subcommand.\n"));
   help_list (srec_cmdlist, "dump srec ", all_commands, gdb_stdout);
 }
 
 static void
-ihex_dump_command (char *cmd, int from_tty)
+ihex_dump_command (const char *cmd, int from_tty)
 {
   printf_unfiltered (_("\"dump ihex\" must be followed by a subcommand.\n"));
   help_list (ihex_cmdlist, "dump ihex ", all_commands, gdb_stdout);
 }
 
 static void
-verilog_dump_command (char *cmd, int from_tty)
+verilog_dump_command (const char *cmd, int from_tty)
 {
   printf_unfiltered (_("\"dump verilog\" must be followed by a subcommand.\n"));
   help_list (verilog_cmdlist, "dump verilog ", all_commands, gdb_stdout);
 }
 
 static void
-tekhex_dump_command (char *cmd, int from_tty)
+tekhex_dump_command (const char *cmd, int from_tty)
 {
   printf_unfiltered (_("\"dump tekhex\" must be followed by a subcommand.\n"));
   help_list (tekhex_cmdlist, "dump tekhex ", all_commands, gdb_stdout);
 }
 
 static void
-binary_dump_command (char *cmd, int from_tty)
+binary_dump_command (const char *cmd, int from_tty)
 {
   printf_unfiltered (_("\"dump binary\" must be followed by a subcommand.\n"));
   help_list (binary_dump_cmdlist, "dump binary ", all_commands, gdb_stdout);
 }
 
 static void
-binary_append_command (char *cmd, int from_tty)
+binary_append_command (const char *cmd, int from_tty)
 {
   printf_unfiltered (_("\"append binary\" must be followed by a subcommand.\n"));
   help_list (binary_append_cmdlist, "append binary ", all_commands,
index 14242e04749b4391b4320220e9fa03d72468b4ed..ee31659389d6cea83d2d81adbad4d7750ccd2ce1 100644 (file)
@@ -172,7 +172,7 @@ set_logging_off (const char *args, int from_tty)
 }
 
 static void
-set_logging_command (char *args, int from_tty)
+set_logging_command (const char *args, int from_tty)
 {
   printf_unfiltered (_("\"set logging\" lets you log output to a file.\n"
                       "Usage: set logging on [FILENAME]\n"
@@ -183,7 +183,7 @@ set_logging_command (char *args, int from_tty)
 }
 
 static void
-show_logging_command (char *args, int from_tty)
+show_logging_command (const char *args, int from_tty)
 {
   if (saved_filename)
     printf_unfiltered (_("Currently logging to \"%s\".\n"), saved_filename);
index b40cd7e496885b52645d5f80010192939a4ec0e5..32ee73af62c88f97f3a012a9537581b733e61b7a 100644 (file)
@@ -165,7 +165,7 @@ extern struct cmd_list_element *add_alias_cmd (const char *,
 
 
 extern struct cmd_list_element *add_prefix_cmd (const char *, enum command_class,
-                                               cmd_cfunc_ftype *fun,
+                                               cmd_const_cfunc_ftype *fun,
                                                const char *,
                                                struct cmd_list_element **,
                                                const char *, int,
index 35d8c86ced9ac3bd4b780ae36574b2bfdc93e882..cd8ce6a1c1841408b5caf73e98cc28bc90db0995 100644 (file)
@@ -609,7 +609,7 @@ compile_to_object (struct command_line *cmd, const char *cmd_string,
 /* The "compile" prefix command.  */
 
 static void
-compile_command (char *args, int from_tty)
+compile_command (const char *args, int from_tty)
 {
   /* If a sub-command is not specified to the compile prefix command,
      assume it is a direct code compilation.  */
index 7bcb155a7f46c32aaa90976deb2118217f70f518..37b2b4af9707a1af7b174dc6eefb79864738d179 100644 (file)
@@ -65,10 +65,6 @@ static void make_symbol_overload_list_qualified (const char *func_name);
 
 struct cmd_list_element *maint_cplus_cmd_list = NULL;
 
-/* The actual commands.  */
-
-static void maint_cplus_command (char *arg, int from_tty);
-
 /* A list of typedefs which should not be substituted by replace_typedefs.  */
 static const char * const ignore_typedefs[] =
   {
@@ -1586,7 +1582,7 @@ gdb_sniff_from_mangled_name (const char *mangled, char **demangled)
 /* Don't allow just "maintenance cplus".  */
 
 static  void
-maint_cplus_command (char *arg, int from_tty)
+maint_cplus_command (const char *arg, int from_tty)
 {
   printf_unfiltered (_("\"maintenance cplus\" must be followed "
                       "by the name of a command.\n"));
index 891fa02fbdd0ee289c7894ef21fc747ec4961f82..c8832fd36b5ba19479f92bf31787bc76ff061c67 100644 (file)
@@ -672,7 +672,7 @@ set_dcache_line_size (char *args, int from_tty,
 }
 
 static void
-set_dcache_command (char *arg, int from_tty)
+set_dcache_command (const char *arg, int from_tty)
 {
   printf_unfiltered (
      "\"set dcache\" must be followed by the name of a subcommand.\n");
@@ -680,7 +680,7 @@ set_dcache_command (char *arg, int from_tty)
 }
 
 static void
-show_dcache_command (char *args, int from_tty)
+show_dcache_command (const char *args, int from_tty)
 {
   cmd_show_list (dcache_show_list, from_tty, "");
 }
index ca5b3a8d08fbbed82f805e6ce3c18d7f49da28ac..979dae2d52ae55fd058555161eb2ae29897e37d4 100644 (file)
@@ -23212,14 +23212,14 @@ static struct cmd_list_element *set_dwarf_cmdlist;
 static struct cmd_list_element *show_dwarf_cmdlist;
 
 static void
-set_dwarf_cmd (char *args, int from_tty)
+set_dwarf_cmd (const char *args, int from_tty)
 {
   help_list (set_dwarf_cmdlist, "maintenance set dwarf ", all_commands,
             gdb_stdout);
 }
 
 static void
-show_dwarf_cmd (char *args, int from_tty)
+show_dwarf_cmd (const char *args, int from_tty)
 {
   cmd_show_list (show_dwarf_cmdlist, from_tty, "");
 }
index 17f7397aeebe8054c1ca7c49885f2bb18cabe14f..8d481694cdb07ea1b48f2fa448f486f6f601866c 100644 (file)
@@ -2906,14 +2906,14 @@ static struct cmd_list_element *set_backtrace_cmdlist;
 static struct cmd_list_element *show_backtrace_cmdlist;
 
 static void
-set_backtrace_cmd (char *args, int from_tty)
+set_backtrace_cmd (const char *args, int from_tty)
 {
   help_list (set_backtrace_cmdlist, "set backtrace ", all_commands,
             gdb_stdout);
 }
 
 static void
-show_backtrace_cmd (char *args, int from_tty)
+show_backtrace_cmd (const char *args, int from_tty)
 {
   cmd_show_list (show_backtrace_cmdlist, from_tty, "");
 }
index fb314c2645ca342fa29a5b06cbf74acd22abbcf0..aa346610f15d10974f9665bf0b3b0b5b4354a4c9 100644 (file)
@@ -577,7 +577,7 @@ extern void finish_thread_state_cleanup (void *ptid_p);
 /* Commands with a prefix of `thread'.  */
 extern struct cmd_list_element *thread_cmd_list;
 
-extern void thread_command (char *tidstr, int from_tty);
+extern void thread_command (const char *tidstr, int from_tty);
 
 /* Print notices on thread events (attach, detach, etc.), set with
    `set print thread-events'.  */
index 0ad35ca33acd317410b0517929f4670827443f0b..7cb6e4a0dd26f1403662c27e151c288792cd3d2f 100644 (file)
@@ -2721,28 +2721,28 @@ struct cmd_list_element *set_thread_default_cmd_list = NULL;
 struct cmd_list_element *show_thread_default_cmd_list = NULL;
 
 static void
-set_thread_cmd (char *args, int from_tty)
+set_thread_cmd (const char *args, int from_tty)
 {
   printf_unfiltered ("\"set thread\" must be followed by the "
                     "name of a thread property, or \"default\".\n");
 }
 
 static void
-show_thread_cmd (char *args, int from_tty)
+show_thread_cmd (const char *args, int from_tty)
 {
   printf_unfiltered ("\"show thread\" must be followed by the "
                     "name of a thread property, or \"default\".\n");
 }
 
 static void
-set_thread_default_cmd (char *args, int from_tty)
+set_thread_default_cmd (const char *args, int from_tty)
 {
   printf_unfiltered ("\"set thread default\" must be followed "
                     "by the name of a thread property.\n");
 }
 
 static void
-show_thread_default_cmd (char *args, int from_tty)
+show_thread_default_cmd (const char *args, int from_tty)
 {
   printf_unfiltered ("\"show thread default\" must be followed "
                     "by the name of a thread property.\n");
@@ -2780,7 +2780,7 @@ _parse_bool_arg (char *args, char *t_val, char *f_val, char *cmd_prefix)
   _parse_bool_arg (args, "on", "off", cmd_prefix)
 
 static void
-check_empty (char *args, char *cmd_prefix)
+check_empty (const char *args, char *cmd_prefix)
 {
   if (args)
     error (_("Garbage after \"%s\" command: `%s'"), cmd_prefix, args);
@@ -3071,14 +3071,14 @@ show_exceptions_cmd (char *args, int from_tty)
 
 \f
 static void
-set_task_cmd (char *args, int from_tty)
+set_task_cmd (const char *args, int from_tty)
 {
   printf_unfiltered ("\"set task\" must be followed by the name"
                     " of a task property.\n");
 }
 
 static void
-show_task_cmd (char *args, int from_tty)
+show_task_cmd (const char *args, int from_tty)
 {
   struct inf *inf = cur_inf ();
 
index 92f7381ef6f2b2ba8d0c1ce323ecc1af0f4d04b7..582b0073a1b891166088eb799810e5995f28828b 100644 (file)
@@ -2053,7 +2053,7 @@ go32_pte_for_address (char *arg, int from_tty)
 static struct cmd_list_element *info_dos_cmdlist = NULL;
 
 static void
-go32_info_dos_command (char *args, int from_tty)
+go32_info_dos_command (const char *args, int from_tty)
 {
   help_list (info_dos_cmdlist, "info dos ", class_info, gdb_stdout);
 }
index d6252d6855e0f306cb6d618f30271fe54485d3c4..5c514f6ace3e76e4502966a3db41e6e80e2190e0 100644 (file)
@@ -425,7 +425,7 @@ static struct cmd_list_element *info_guile_list;
 /* Function for use by 'set guile' prefix command.  */
 
 static void
-set_guile_command (char *args, int from_tty)
+set_guile_command (const char *args, int from_tty)
 {
   help_list (set_guile_list, "set guile ", all_commands, gdb_stdout);
 }
@@ -433,7 +433,7 @@ set_guile_command (char *args, int from_tty)
 /* Function for use by 'show guile' prefix command.  */
 
 static void
-show_guile_command (char *args, int from_tty)
+show_guile_command (const char *args, int from_tty)
 {
   cmd_show_list (show_guile_list, from_tty, "");
 }
@@ -443,7 +443,7 @@ show_guile_command (char *args, int from_tty)
    "info scheme" with no args.  */
 
 static void
-info_guile_command (char *args, int from_tty)
+info_guile_command (const char *args, int from_tty)
 {
   printf_unfiltered (_("\"info guile\" must be followed"
                       " by the name of an info command.\n"));
index f26d624483ede8243cbe0fdd6997cc2e00feb10b..9eb1192ff5b18f499c915fdddca3587f3b608a32 100644 (file)
@@ -8971,7 +8971,7 @@ static struct cmd_list_element *mpx_set_cmdlist, *mpx_show_cmdlist;
 /* Helper function for the CLI commands.  */
 
 static void
-set_mpx_cmd (char *args, int from_tty)
+set_mpx_cmd (const char *args, int from_tty)
 {
   help_list (mpx_set_cmdlist, "set mpx ", all_commands, gdb_stdout);
 }
@@ -8979,7 +8979,7 @@ set_mpx_cmd (char *args, int from_tty)
 /* Helper function for the CLI commands.  */
 
 static void
-show_mpx_cmd (char *args, int from_tty)
+show_mpx_cmd (const char *args, int from_tty)
 {
   cmd_show_list (mpx_show_cmdlist, from_tty, "");
 }
index 187c71f34461ef781c5c6fa6f4a20bc674400af7..669631bdb43f8787da59939f12eefec96cee97c8 100644 (file)
@@ -70,8 +70,6 @@ static void until_command (char *, int);
 
 static void path_command (char *, int);
 
-static void unset_command (char *, int);
-
 static void info_float_command (char *, int);
 
 static void disconnect_command (char *, int);
@@ -2624,7 +2622,7 @@ info_vector_command (char *args, int from_tty)
 /* Kill the inferior process.  Make us have no inferior.  */
 
 static void
-kill_command (char *arg, int from_tty)
+kill_command (const char *arg, int from_tty)
 {
   /* FIXME:  This should not really be inferior_ptid (or target_has_execution).
      It should be a distinct flag that indicates that a target is active, cuz
@@ -3028,7 +3026,7 @@ notice_new_inferior (ptid_t ptid, int leave_running, int from_tty)
  */
 
 void
-detach_command (char *args, int from_tty)
+detach_command (const char *args, int from_tty)
 {
   dont_repeat ();              /* Not for the faint of heart.  */
 
@@ -3172,7 +3170,7 @@ info_float_command (char *args, int from_tty)
 }
 \f
 static void
-unset_command (char *args, int from_tty)
+unset_command (const char *args, int from_tty)
 {
   printf_filtered (_("\"unset\" must be followed by the "
                     "name of an unset subcommand.\n"));
@@ -3198,7 +3196,7 @@ info_proc_cmd_1 (const char *args, enum info_proc_what what, int from_tty)
 /* Implement `info proc' when given without any futher parameters.  */
 
 static void
-info_proc_cmd (char *args, int from_tty)
+info_proc_cmd (const char *args, int from_tty)
 {
   info_proc_cmd_1 (args, IP_MINIMAL, from_tty);
 }
index 498d74706a7802983267170c5a92514ef5843599..39a8877b22395e51145996a977a8fcf32a6fdd0c 100644 (file)
@@ -168,7 +168,7 @@ extern void interrupt_target_1 (int all_threads);
 
 extern void delete_longjmp_breakpoint_cleanup (void *arg);
 
-extern void detach_command (char *, int);
+extern void detach_command (const char *, int);
 
 extern void notice_new_inferior (ptid_t, int, int);
 
index e92c3c55a5e58491c474aeffc38fc78f023710d2..ecdf431743f58cf552121e425120ead0e9e8f5a1 100644 (file)
@@ -50,10 +50,6 @@ static void unk_lang_error (const char *);
 
 static int unk_lang_parser (struct parser_state *);
 
-static void show_check (char *, int);
-
-static void set_check (char *, int);
-
 static void set_range_case (void);
 
 static void unk_lang_emit_char (int c, struct type *type,
@@ -507,7 +503,7 @@ language_str (enum language lang)
 }
 
 static void
-set_check (char *ignore, int from_tty)
+set_check (const char *ignore, int from_tty)
 {
   printf_unfiltered (
      "\"set check\" must be followed by the name of a check subcommand.\n");
@@ -515,7 +511,7 @@ set_check (char *ignore, int from_tty)
 }
 
 static void
-show_check (char *ignore, int from_tty)
+show_check (const char *ignore, int from_tty)
 {
   cmd_show_list (showchecklist, from_tty, "");
 }
index 0db43dc76036990410da5385e20158d0c0408744..2bb8705fd6a89ffe080b52fb41b02d0b2e30f0d7 100644 (file)
@@ -33,7 +33,7 @@
 static struct cmd_list_element *macrolist;
 
 static void
-macro_command (char *arg, int from_tty)
+macro_command (const char *arg, int from_tty)
 {
   printf_unfiltered
     ("\"macro\" must be followed by the name of a macro command.\n");
index 6c0dec2856f6facc27aed65216709cbc60c1b1be..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_space_display (char *, int);
 
-static void maintenance_info_command (char *, int);
-
-static void maintenance_print_command (char *, int);
-
 static void maintenance_do_deprecate (const char *, int);
 
 /* Set this to the maximum number of seconds to wait instead of waiting forever
@@ -73,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"));
@@ -162,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"));
@@ -175,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"));
@@ -421,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"));
@@ -644,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"));
@@ -653,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, "");
 }
@@ -916,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;
@@ -937,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, "");
 }
index 5be6397bd0e01f5cd8f188800f442baf3d6f28a6..6ed126b75b98af128995a70ee272c3423f65fcfb 100644 (file)
@@ -684,7 +684,7 @@ delete_mem_command (const char *args, int from_tty)
 }
 
 static void
-dummy_cmd (char *args, int from_tty)
+dummy_cmd (const char *args, int from_tty)
 {
 }
 
index 05d7ae1e878c9f83868baac8da909ce9ceca7aab..4eafe3e308e806e6231055d660d7b1f182120472 100644 (file)
@@ -6877,13 +6877,13 @@ mips_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc)
    used for all MIPS-specific commands.  */
 
 static void
-show_mips_command (char *args, int from_tty)
+show_mips_command (const char *args, int from_tty)
 {
   help_list (showmipscmdlist, "show mips ", all_commands, gdb_stdout);
 }
 
 static void
-set_mips_command (char *args, int from_tty)
+set_mips_command (const char *args, int from_tty)
 {
   printf_unfiltered
     ("\"set mips\" must be followed by an appropriate subcommand.\n");
@@ -6930,7 +6930,7 @@ show_mipsfpu_command (const char *args, int from_tty)
 
 
 static void
-set_mipsfpu_command (char *args, int from_tty)
+set_mipsfpu_command (const char *args, int from_tty)
 {
   printf_unfiltered ("\"set mipsfpu\" must be followed by \"double\", "
                     "\"single\",\"none\" or \"auto\".\n");
index a8743f1f71fe8c6073059c9421881fbf7dd494a2..77a05e5d9f2ec7a0083a2d3b8194fc0ecb4bd3b4 100644 (file)
@@ -1262,7 +1262,7 @@ output_command_const (const char *exp, int from_tty)
 }
 
 static void
-set_command (char *exp, int from_tty)
+set_command (const char *exp, int from_tty)
 {
   expression_up expr = parse_expression (exp);
 
@@ -1285,6 +1285,14 @@ set_command (char *exp, int from_tty)
   evaluate_expression (expr.get ());
 }
 
+/* Temporary non-const version of set_command.  */
+
+static void
+non_const_set_command (char *exp, int from_tty)
+{
+  set_command (exp, from_tty);
+}
+
 static void
 info_symbol_command (char *arg, int from_tty)
 {
@@ -2749,7 +2757,7 @@ With a subcommand, this command modifies parts of the gdb environment.\n\
 You can see these environment settings with the \"show\" command."),
                  &setlist, "set ", 1, &cmdlist);
   if (dbx_commands)
-    add_com ("assign", class_vars, set_command, _("\
+    add_com ("assign", class_vars, non_const_set_command, _("\
 Evaluate expression EXP and assign result to variable VAR, using assignment\n\
 syntax appropriate for the current language (VAR = EXP or VAR := EXP for\n\
 example).  VAR may be a debugger \"convenience\" variable (names starting\n\
index c6435e48ba2afcd7537f5695769e227f6d934a44..b3dbf896b95bd77b98e8978899f5a2c793e2bd13 100644 (file)
@@ -666,7 +666,7 @@ info_probes_for_ops (const char *arg, int from_tty,
 /* Implementation of the `info probes' command.  */
 
 static void
-info_probes_command (char *arg, int from_tty)
+info_probes_command (const char *arg, int from_tty)
 {
   info_probes_for_ops (arg, from_tty, NULL);
 }
index b04057ec4a45da116d10397abf04b81af2411f3b..5bb642a50aa245e81c9f477949fa4410c5de05df 100644 (file)
@@ -1428,7 +1428,7 @@ static struct cmd_list_element *user_show_python_list;
 /* Function for use by 'set python' prefix command.  */
 
 static void
-user_set_python (char *args, int from_tty)
+user_set_python (const char *args, int from_tty)
 {
   help_list (user_set_python_list, "set python ", all_commands,
             gdb_stdout);
@@ -1437,7 +1437,7 @@ user_set_python (char *args, int from_tty)
 /* Function for use by 'show python' prefix command.  */
 
 static void
-user_show_python (char *args, int from_tty)
+user_show_python (const char *args, int from_tty)
 {
   cmd_show_list (user_show_python_list, from_tty, "");
 }
index 1f93e3df0eb4c38bae9ca7f4ec2c4d6622cbb986..7e3015d1c78d0344f446ddafaec2550abfb45082 100644 (file)
@@ -391,7 +391,7 @@ static struct cmd_list_element *show_ravenscar_list;
 /* Implement the "set ravenscar" prefix command.  */
 
 static void
-set_ravenscar_command (char *arg, int from_tty)
+set_ravenscar_command (const char *arg, int from_tty)
 {
   printf_unfiltered (_(\
 "\"set ravenscar\" must be followed by the name of a setting.\n"));
@@ -401,7 +401,7 @@ set_ravenscar_command (char *arg, int from_tty)
 /* Implement the "show ravenscar" prefix command.  */
 
 static void
-show_ravenscar_command (char *args, int from_tty)
+show_ravenscar_command (const char *args, int from_tty)
 {
   cmd_show_list (show_ravenscar_list, from_tty, "");
 }
index 77844bc52a52ca2997d4610774fda53d38c402bf..36ddf1c2233821e894b15d8b46d4d2aa8992a2df 100644 (file)
@@ -2927,7 +2927,7 @@ cmd_record_btrace_pt_start (const char *args, int from_tty)
 /* Alias for "target record".  */
 
 static void
-cmd_record_btrace_start (char *args, int from_tty)
+cmd_record_btrace_start (const char *args, int from_tty)
 {
   if (args != NULL && *args != 0)
     error (_("Invalid argument."));
@@ -2959,7 +2959,7 @@ cmd_record_btrace_start (char *args, int from_tty)
 /* The "set record btrace" command.  */
 
 static void
-cmd_set_record_btrace (char *args, int from_tty)
+cmd_set_record_btrace (const char *args, int from_tty)
 {
   cmd_show_list (set_record_btrace_cmdlist, from_tty, "");
 }
@@ -2967,7 +2967,7 @@ cmd_set_record_btrace (char *args, int from_tty)
 /* The "show record btrace" command.  */
 
 static void
-cmd_show_record_btrace (char *args, int from_tty)
+cmd_show_record_btrace (const char *args, int from_tty)
 {
   cmd_show_list (show_record_btrace_cmdlist, from_tty, "");
 }
@@ -2985,7 +2985,7 @@ cmd_show_replay_memory_access (struct ui_file *file, int from_tty,
 /* The "set record btrace bts" command.  */
 
 static void
-cmd_set_record_btrace_bts (char *args, int from_tty)
+cmd_set_record_btrace_bts (const char *args, int from_tty)
 {
   printf_unfiltered (_("\"set record btrace bts\" must be followed "
                       "by an appropriate subcommand.\n"));
@@ -2996,7 +2996,7 @@ cmd_set_record_btrace_bts (char *args, int from_tty)
 /* The "show record btrace bts" command.  */
 
 static void
-cmd_show_record_btrace_bts (char *args, int from_tty)
+cmd_show_record_btrace_bts (const char *args, int from_tty)
 {
   cmd_show_list (show_record_btrace_bts_cmdlist, from_tty, "");
 }
@@ -3004,7 +3004,7 @@ cmd_show_record_btrace_bts (char *args, int from_tty)
 /* The "set record btrace pt" command.  */
 
 static void
-cmd_set_record_btrace_pt (char *args, int from_tty)
+cmd_set_record_btrace_pt (const char *args, int from_tty)
 {
   printf_unfiltered (_("\"set record btrace pt\" must be followed "
                       "by an appropriate subcommand.\n"));
@@ -3015,7 +3015,7 @@ cmd_set_record_btrace_pt (char *args, int from_tty)
 /* The "show record btrace pt" command.  */
 
 static void
-cmd_show_record_btrace_pt (char *args, int from_tty)
+cmd_show_record_btrace_pt (const char *args, int from_tty)
 {
   cmd_show_list (show_record_btrace_pt_cmdlist, from_tty, "");
 }
index a3283d3942dc7963b52712b375cae68f62968a8b..37836e75d09e3b32d042df6815bfa6be4143da6f 100644 (file)
@@ -2755,7 +2755,7 @@ record_full_goto_insn (struct record_full_entry *entry,
 /* Alias for "target record-full".  */
 
 static void
-cmd_record_full_start (char *args, int from_tty)
+cmd_record_full_start (const char *args, int from_tty)
 {
   execute_command ((char *) "target record-full", from_tty);
 }
@@ -2778,10 +2778,10 @@ set_record_full_insn_max_num (char *args, int from_tty,
 /* The "set record full" command.  */
 
 static void
-set_record_full_command (char *args, int from_tty)
+set_record_full_command (const char *args, int from_tty)
 {
   printf_unfiltered (_("\"set record full\" must be followed "
-                      "by an apporpriate subcommand.\n"));
+                      "by an appropriate subcommand.\n"));
   help_list (set_record_full_cmdlist, "set record full ", all_commands,
             gdb_stdout);
 }
@@ -2789,7 +2789,7 @@ set_record_full_command (char *args, int from_tty)
 /* The "show record full" command.  */
 
 static void
-show_record_full_command (char *args, int from_tty)
+show_record_full_command (const char *args, int from_tty)
 {
   cmd_show_list (show_record_full_cmdlist, from_tty, "");
 }
index f4ef2692a1fff1d429ca4b9218f4dc2e8edf33b8..5ecdcfc5f98834dc2e0742e1c26833a5eb91b419 100644 (file)
@@ -263,7 +263,7 @@ show_record_debug (struct ui_file *file, int from_tty,
 /* Alias for "target record".  */
 
 static void
-cmd_record_start (char *args, int from_tty)
+cmd_record_start (const char *args, int from_tty)
 {
   execute_command ((char *) "target record-full", from_tty);
 }
@@ -316,7 +316,7 @@ cmd_record_stop (const char *args, int from_tty)
 /* The "set record" command.  */
 
 static void
-set_record_command (char *args, int from_tty)
+set_record_command (const char *args, int from_tty)
 {
   printf_unfiltered (_("\"set record\" must be followed "
                       "by an apporpriate subcommand.\n"));
@@ -326,7 +326,7 @@ set_record_command (char *args, int from_tty)
 /* The "show record" command.  */
 
 static void
-show_record_command (char *args, int from_tty)
+show_record_command (const char *args, int from_tty)
 {
   cmd_show_list (show_record_cmdlist, from_tty, "");
 }
@@ -334,7 +334,7 @@ show_record_command (char *args, int from_tty)
 /* The "info record" command.  */
 
 static void
-info_record_command (char *args, int from_tty)
+info_record_command (const char *args, int from_tty)
 {
   struct target_ops *t;
 
@@ -394,7 +394,7 @@ record_goto (const char *arg)
    Rewinds the recording (forward or backward) to the given instruction.  */
 
 static void
-cmd_record_goto (char *arg, int from_tty)
+cmd_record_goto (const char *arg, int from_tty)
 {
   record_goto (arg);
 }
index 3ceabcf1aadce7c335821e7be9e46e73619c72a1..e06e807712919f78de4223ea343759e9f733f458 100644 (file)
@@ -12252,7 +12252,7 @@ remote_delete_command (const char *args, int from_tty)
 }
 
 static void
-remote_command (char *args, int from_tty)
+remote_command (const char *args, int from_tty)
 {
   help_list (remote_cmdlist, "remote ", all_commands, gdb_stdout);
 }
@@ -13964,13 +13964,13 @@ remote_thread_events (struct target_ops *ops, int enable)
 }
 
 static void
-set_remote_cmd (char *args, int from_tty)
+set_remote_cmd (const char *args, int from_tty)
 {
   help_list (remote_set_cmdlist, "set remote ", all_commands, gdb_stdout);
 }
 
 static void
-show_remote_cmd (char *args, int from_tty)
+show_remote_cmd (const char *args, int from_tty)
 {
   /* We can't just use cmd_show_list here, because we want to skip
      the redundant "show remote Z-packet" and the legacy aliases.  */
index 95b2ca71c9489673a934bab51cee7d3ca22e62f3..92395adb1a293b30b55c4096aba95359cc03a4ba 100644 (file)
@@ -6618,7 +6618,7 @@ rs6000_dump_tdep (struct gdbarch *gdbarch, struct ui_file *file)
 /* PowerPC-specific commands.  */
 
 static void
-set_powerpc_command (char *args, int from_tty)
+set_powerpc_command (const char *args, int from_tty)
 {
   printf_unfiltered (_("\
 \"set powerpc\" must be followed by an appropriate subcommand.\n"));
@@ -6626,7 +6626,7 @@ set_powerpc_command (char *args, int from_tty)
 }
 
 static void
-show_powerpc_command (char *args, int from_tty)
+show_powerpc_command (const char *args, int from_tty)
 {
   cmd_show_list (showpowerpccmdlist, from_tty, "");
 }
index c5bc6bdd11672c37acef79cc9198654980bde2f4..7ff588b09d54040d0cb37096d2d7575de25c50ad 100644 (file)
@@ -368,13 +368,13 @@ ser_tcp_send_break (struct serial *scb)
 /* Support for "set tcp" and "show tcp" commands.  */
 
 static void
-set_tcp_cmd (char *args, int from_tty)
+set_tcp_cmd (const char *args, int from_tty)
 {
   help_list (tcp_set_cmdlist, "set tcp ", all_commands, gdb_stdout);
 }
 
 static void
-show_tcp_cmd (char *args, int from_tty)
+show_tcp_cmd (const char *args, int from_tty)
 {
   help_list (tcp_show_cmdlist, "show tcp ", all_commands, gdb_stdout);
 }
index 91fdcbb3677a94f16fd30aa3cb7a53a20d473708..686654913073062e7e62aa5149ab97d0fd155983 100644 (file)
@@ -627,7 +627,7 @@ static struct cmd_list_element *serial_set_cmdlist;
 static struct cmd_list_element *serial_show_cmdlist;
 
 static void
-serial_set_cmd (char *args, int from_tty)
+serial_set_cmd (const char *args, int from_tty)
 {
   printf_unfiltered ("\"set serial\" must be followed "
                     "by the name of a command.\n");
@@ -635,7 +635,7 @@ serial_set_cmd (char *args, int from_tty)
 }
 
 static void
-serial_show_cmd (char *args, int from_tty)
+serial_show_cmd (const char *args, int from_tty)
 {
   cmd_show_list (serial_show_cmdlist, from_tty, "");
 }
index 7d941e6235874a7a145be937f1fa6b01686f15a6..dc89caee5e6a0ea2ced9bd43a2047294c215f2fd 100644 (file)
@@ -2436,13 +2436,13 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 }
 
 static void
-show_sh_command (char *args, int from_tty)
+show_sh_command (const char *args, int from_tty)
 {
   help_list (showshcmdlist, "show sh ", all_commands, gdb_stdout);
 }
 
 static void
-set_sh_command (char *args, int from_tty)
+set_sh_command (const char *args, int from_tty)
 {
   printf_unfiltered
     ("\"set sh\" must be followed by an appropriate subcommand.\n");
index 6e82a33163db168b828c6a67cc0f47c4e21c5b87..af60eb74042bd7ffaf93ffb6f078e2576a6b8776 100644 (file)
@@ -226,7 +226,7 @@ skip_function_command (const char *arg, int from_tty)
 /* Process "skip ..." that does not match "skip file" or "skip function".  */
 
 static void
-skip_command (char *arg, int from_tty)
+skip_command (const char *arg, int from_tty)
 {
   const char *file = NULL;
   const char *gfile = NULL;
index b4ae1656785fab9234368773e97e4f5f49354e3b..2fbeec0e988176b1102f97f31a9e1d82952dfeb0 100644 (file)
@@ -187,7 +187,7 @@ sparc64_forget_process (pid_t pid)
 }
 
 static void
-info_adi_command (char *args, int from_tty)
+info_adi_command (const char *args, int from_tty)
 {
   printf_unfiltered ("\"adi\" must be followed by \"examine\" "
                      "or \"assign\".\n");
index a7eb27d6381bf5f01df411bba7891cb61ae6e2af..736993e1ca94eb56ec7b88b8dd6a44f541d5dae7 100644 (file)
@@ -2596,7 +2596,7 @@ info_spu_proxydma_command (const char *args, int from_tty)
 }
 
 static void
-info_spu_command (char *args, int from_tty)
+info_spu_command (const char *args, int from_tty)
 {
   printf_unfiltered (_("\"info spu\" must be followed by "
                       "the name of an SPU facility.\n"));
@@ -2607,13 +2607,13 @@ info_spu_command (char *args, int from_tty)
 /* Root of all "set spu "/"show spu " commands.  */
 
 static void
-show_spu_command (char *args, int from_tty)
+show_spu_command (const char *args, int from_tty)
 {
   help_list (showspucmdlist, "show spu ", all_commands, gdb_stdout);
 }
 
 static void
-set_spu_command (char *args, int from_tty)
+set_spu_command (const char *args, int from_tty)
 {
   help_list (setspucmdlist, "set spu ", all_commands, gdb_stdout);
 }
index b4abe84541bb7d5a762836315722536be6871320..c69a474985f4d7ab8183b3ca869ac219dc41868a 100644 (file)
@@ -92,8 +92,6 @@ static const struct sym_fns *find_sym_fns (bfd *);
 
 static void overlay_invalidate_all (void);
 
-static void overlay_command (char *, int);
-
 static void simple_free_overlay_table (void);
 
 static void read_target_long_array (CORE_ADDR, unsigned int *, int, int,
@@ -3388,7 +3386,7 @@ overlay_load_command (const char *args, int from_tty)
 static struct cmd_list_element *overlaylist;
 
 static void
-overlay_command (char *args, int from_tty)
+overlay_command (const char *args, int from_tty)
 {
   printf_unfiltered
     ("\"overlay\" must be followed by the name of an overlay command.\n");
index 06cfbb50e2c56ba3d0a9a416159607e32df4859b..4f5e9d60a6d98b5855d6ee4ffeaa9fd7149d6395 100644 (file)
@@ -1856,19 +1856,19 @@ static struct cmd_list_element *tdesc_unset_cmdlist;
 /* Helper functions for the CLI commands.  */
 
 static void
-set_tdesc_cmd (char *args, int from_tty)
+set_tdesc_cmd (const char *args, int from_tty)
 {
   help_list (tdesc_set_cmdlist, "set tdesc ", all_commands, gdb_stdout);
 }
 
 static void
-show_tdesc_cmd (char *args, int from_tty)
+show_tdesc_cmd (const char *args, int from_tty)
 {
   cmd_show_list (tdesc_show_cmdlist, from_tty, "");
 }
 
 static void
-unset_tdesc_cmd (char *args, int from_tty)
+unset_tdesc_cmd (const char *args, int from_tty)
 {
   help_list (tdesc_unset_cmdlist, "unset tdesc ", all_commands, gdb_stdout);
 }
index f2dccd23ced7034a35e843a7a6527bed5d993945..4a7589d445ec4a52d6321ee21dd6dd8f740e6bc5 100644 (file)
@@ -90,8 +90,6 @@ static int return_zero (struct target_ops *);
 
 static int return_zero_has_execution (struct target_ops *, ptid_t);
 
-static void target_command (char *, int);
-
 static struct target_ops *find_default_run_target (const char *);
 
 static struct gdbarch *default_thread_architecture (struct target_ops *ops,
@@ -188,7 +186,7 @@ static void setup_target_debug (void);
 /* The user just typed 'target' without the name of a target.  */
 
 static void
-target_command (char *arg, int from_tty)
+target_command (const char *arg, int from_tty)
 {
   fputs_filtered ("Argument required (target name).  Try `help target'\n",
                  gdb_stdout);
index 16688629eed1998dabf60ee9c96bfb00f0e2d7d9..df04b4ed6a1464549e754502aa7b3a1dfa1b694d 100644 (file)
@@ -63,7 +63,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);
-static void thread_apply_command (char *, int);
 
 /* RAII type used to increase / decrease the refcount of each thread
    in a given list of threads.  */
@@ -1721,7 +1720,7 @@ thread_apply_all_command (char *cmd, int from_tty)
 /* Implementation of the "thread apply" command.  */
 
 static void
-thread_apply_command (char *tidlist, int from_tty)
+thread_apply_command (const char *tidlist, int from_tty)
 {
   char *cmd = NULL;
   tid_range_parser parser;
@@ -1814,7 +1813,7 @@ thread_apply_command (char *tidlist, int from_tty)
    if prefix of arg is `apply'.  */
 
 void
-thread_command (char *tidstr, int from_tty)
+thread_command (const char *tidstr, int from_tty)
 {
   if (tidstr == NULL)
     {
index ed109344b2838eff16805698b0cf91d2aa37c517..3b3bbee4ac6256df34205aca57d1867e7e7acbe6 100644 (file)
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -1758,7 +1758,7 @@ set_history_size_command (char *args, int from_tty, struct cmd_list_element *c)
 }
 
 void
-set_history (char *args, int from_tty)
+set_history (const char *args, int from_tty)
 {
   printf_unfiltered (_("\"set history\" must be followed "
                       "by the name of a history subcommand.\n"));
@@ -1766,7 +1766,7 @@ set_history (char *args, int from_tty)
 }
 
 void
-show_history (char *args, int from_tty)
+show_history (const char *args, int from_tty)
 {
   cmd_show_list (showhistlist, from_tty, "");
 }
index 99ba010821ade43087e86d10dcfbb4ddc6d591bb..ab21e5e013076d2c7349e9907e723eef65bbb8a3 100644 (file)
--- a/gdb/top.h
+++ b/gdb/top.h
@@ -282,9 +282,9 @@ extern void gdb_add_history (const char *);
 
 extern void show_commands (char *args, int from_tty);
 
-extern void set_history (char *, int);
+extern void set_history (const char *, int);
 
-extern void show_history (char *, int);
+extern void show_history (const char *, int);
 
 extern void set_verbose (char *, int, struct cmd_list_element *);
 
index 72e920b1db0437f1305331854a59c06c382d0daf..c66a4b39c529045ccd4babe0678c224d536e6d7f 100644 (file)
@@ -2332,7 +2332,7 @@ tfind_command_1 (const char *args, int from_tty)
 }
 
 static void
-tfind_command (char *args, int from_tty)
+tfind_command (const char *args, int from_tty)
 {
   tfind_command_1 (const_cast<char *> (args), from_tty);
 }
index cb8e475b727f5abfdbdcdc2bb3344a0768bb3ef6..7dbd76b043fec396e09ced8f260c997d2befa43d 100644 (file)
@@ -316,19 +316,19 @@ tui_update_variables (void)
 }
 
 static void
-set_tui_cmd (char *args, int from_tty)
+set_tui_cmd (const char *args, int from_tty)
 {
 }
 
 static void
-show_tui_cmd (char *args, int from_tty)
+show_tui_cmd (const char *args, int from_tty)
 {
 }
 
 static struct cmd_list_element *tuilist;
 
 static void
-tui_command (char *args, int from_tty)
+tui_command (const char *args, int from_tty)
 {
   printf_unfiltered (_("\"tui\" must be followed by the name of a "
                      "tui command.\n"));
index 8ee44af9b98fdb23b765bab8aee46fed0c1ecf2f..441cbb8742af9cf2b37b6639bcf9ba86c1420395 100644 (file)
@@ -662,7 +662,7 @@ struct cmd_list_element *setprinttypelist;
 struct cmd_list_element *showprinttypelist;
 
 static void
-set_print_type (char *arg, int from_tty)
+set_print_type (const char *arg, int from_tty)
 {
   printf_unfiltered (
      "\"set print type\" must be followed by the name of a subcommand.\n");
@@ -670,7 +670,7 @@ set_print_type (char *arg, int from_tty)
 }
 
 static void
-show_print_type (char *args, int from_tty)
+show_print_type (const char *args, int from_tty)
 {
   cmd_show_list (showprinttypelist, from_tty, "");
 }
index 07841afb8f19ffad3e2a8e86bf85e45e80d0abab..dd746849c719d790f820c16c5e50b794399f2842 100644 (file)
@@ -550,12 +550,12 @@ demangler_warning (const char *file, int line, const char *string, ...)
 /* Dummy functions to keep add_prefix_cmd happy.  */
 
 static void
-set_internal_problem_cmd (char *args, int from_tty)
+set_internal_problem_cmd (const char *args, int from_tty)
 {
 }
 
 static void
-show_internal_problem_cmd (char *args, int from_tty)
+show_internal_problem_cmd (const char *args, int from_tty)
 {
 }
 
@@ -593,14 +593,14 @@ add_internal_problem_command (struct internal_problem *problem)
   show_doc = xstrprintf (_("Show what GDB does when %s is detected."),
                         problem->name);
 
-  add_prefix_cmd ((char*) problem->name,
+  add_prefix_cmd (problem->name,
                  class_maintenance, set_internal_problem_cmd, set_doc,
                  set_cmd_list,
                  concat ("maintenance set ", problem->name, " ",
                          (char *) NULL),
                  0/*allow-unknown*/, &maintenance_set_cmdlist);
 
-  add_prefix_cmd ((char*) problem->name,
+  add_prefix_cmd (problem->name,
                  class_maintenance, show_internal_problem_cmd, show_doc,
                  show_cmd_list,
                  concat ("maintenance show ", problem->name, " ",
index ca0c4768c9eb78c456e00b6f44ffb84d0eca20be..2dd383f6d4c5d10945ffe9872860a928bfac211c 100644 (file)
@@ -84,10 +84,6 @@ struct cmd_list_element *showprintrawlist;
 static int partial_memory_read (CORE_ADDR memaddr, gdb_byte *myaddr,
                                int len, int *errptr);
 
-static void show_print (char *, int);
-
-static void set_print (char *, int);
-
 static void set_input_radix (char *, int, struct cmd_list_element *);
 
 static void set_input_radix_1 (int, unsigned);
@@ -3129,7 +3125,7 @@ show_radix (const char *arg, int from_tty)
 \f
 
 static void
-set_print (char *arg, int from_tty)
+set_print (const char *arg, int from_tty)
 {
   printf_unfiltered (
      "\"set print\" must be followed by the name of a print subcommand.\n");
@@ -3137,13 +3133,13 @@ set_print (char *arg, int from_tty)
 }
 
 static void
-show_print (char *args, int from_tty)
+show_print (const char *args, int from_tty)
 {
   cmd_show_list (showprintlist, from_tty, "");
 }
 
 static void
-set_print_raw (char *arg, int from_tty)
+set_print_raw (const char *arg, int from_tty)
 {
   printf_unfiltered (
      "\"set print raw\" must be followed by the name of a \"print raw\" subcommand.\n");
@@ -3151,7 +3147,7 @@ set_print_raw (char *arg, int from_tty)
 }
 
 static void
-show_print_raw (char *args, int from_tty)
+show_print_raw (const char *args, int from_tty)
 {
   cmd_show_list (showprintrawlist, from_tty, "");
 }
index 90423ed00286899fd10741bae65ea87526259382..7d0966c8fe19dea8c99da8c2aaac2efa4f804c90 100644 (file)
@@ -2558,7 +2558,7 @@ call_internal_function (struct gdbarch *gdbarch,
    the implementation of the sub-command that is created when
    registering an internal function.  */
 static void
-function_command (char *command, int from_tty)
+function_command (const char *command, int from_tty)
 {
   /* Do nothing.  */
 }
index 98b6d2b9324902d60177bde0ece4c9d2954ffade..698794fd192e60506d4a2f9e445c479e988540bc 100644 (file)
@@ -444,7 +444,7 @@ show_maint_show_all_tib (struct ui_file *file, int from_tty,
 }
 
 static void
-info_w32_command (char *args, int from_tty)
+info_w32_command (const char *args, int from_tty)
 {
   help_list (info_w32_cmdlist, "info w32 ", class_info, gdb_stdout);
 }
This page took 0.083804 seconds and 4 git commands to generate.