Constify add_setshow_*
authorTom Tromey <tom@tromey.com>
Sat, 14 Oct 2017 15:07:00 +0000 (09:07 -0600)
committerTom Tromey <tom@tromey.com>
Tue, 7 Nov 2017 20:59:09 +0000 (13:59 -0700)
This constifies the add_setshow_* family of functions, and then fixes
up the fallout.  The bulk of this patch was written by script.

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

* ada-lang.c (catch_ada_exception_command): Constify.
(catch_assert_command): Constify.
* break-catch-throw.c (catch_catch_command, catch_throw_command)
(catch_rethrow_command): Constify.
(catch_exception_command_1): Constify.
* breakpoint.h (add_catch_command): Constify.
* break-catch-syscall.c (catch_syscall_command_1): Constify.
(catch_syscall_split_args): Constify.
* break-catch-sig.c (catch_signal_command): Constify.
(catch_signal_split_args): Constify.
* cli/cli-decode.h (struct cmd_list_element) <function>: Use
cmd_const_sfunc_ftype.
* cli/cli-decode.c (add_setshow_cmd_full): Constify.
(add_setshow_enum_cmd, add_setshow_auto_boolean_cmd)
(add_setshow_boolean_cmd, add_setshow_filename_cmd)
(add_setshow_string_cmd, struct cmd_list_element)
(add_setshow_optional_filename_cmd, add_setshow_integer_cmd)
(add_setshow_uinteger_cmd, add_setshow_zinteger_cmd)
(add_setshow_zuinteger_unlimited_cmd, add_setshow_zuinteger_cmd):
Constify.
(set_cmd_sfunc): Constify.
(empty_sfunc): Constify.
* command.h (add_setshow_enum_cmd, add_setshow_auto_boolean_cmd)
(add_setshow_boolean_cmd, add_setshow_filename_cmd)
(add_setshow_string_cmd, add_setshow_string_noescape_cmd)
(add_setshow_optional_filename_cmd, add_setshow_integer_cmd)
(add_setshow_uinteger_cmd, add_setshow_zinteger_cmd)
(add_setshow_zuinteger_cmd, add_setshow_zuinteger_unlimited_cmd):
Constify.
(set_cmd_sfunc): Constify.
(cmd_sfunc_ftype): Remove.
* compile/compile.c (set_compile_args): Constify.
* infrun.c (set_disable_randomization): Constify.
* infcmd.c (set_args_command, set_cwd_command): Constify.
* breakpoint.c (set_condition_evaluation_mode): Constify.
(add_catch_command): Constify.
(catch_fork_command_1, catch_exec_command_1)
(catch_load_command_1, catch_unload_command_1): Constify.
(catch_load_or_unload): Constify.
* guile/scm-param.c (pascm_set_func): Constify.
(add_setshow_generic): Constify.
* python/py-param.c (get_set_value): Constify.
* top.h (set_verbose): Constify.
* tui/tui-win.c (tui_set_var_cmd): Constify.
* mi/mi-main.c (set_mi_async_command): Constify.
* cli/cli-logging.c (set_logging_overwrite)
(set_logging_redirect): Constify.
* value.c (set_max_value_size): Constify.
* valprint.c (set_input_radix, set_output_radix): Constify.
* utils.c (set_width_command, set_height_command): Constify.
* typeprint.c (set_print_type_methods, set_print_type_typedefs): Constify.
* tracepoint.c (set_disconnected_tracing)
(set_circular_trace_buffer, set_trace_buffer_size)
(set_trace_user, set_trace_notes, set_trace_stop_notes): Constify.
* top.c (set_history_size_command, set_verbose, set_editing)
(set_gdb_datadir, set_history_filename): Constify.
* target.c (set_targetdebug, maint_set_target_async_command)
(maint_set_target_non_stop_command, set_target_permissions)
(set_write_memory_permission): Constify.
(open_target): Constify.
* target-descriptions.c (set_tdesc_filename_cmd): Constify.
* target-dcache.c (set_stack_cache, set_code_cache): Constify.
* symtab.c (set_symbol_cache_size_handler): Constify.
* symfile.c (set_ext_lang_command): Constify.
* symfile-debug.c (set_debug_symfile): Constify.
* source.c (set_directories_command): Constify.
* solib.c (reload_shared_libraries, gdb_sysroot_changed): Constify.
* serial.c (set_parity): Constify.
* rs6000-tdep.c (powerpc_set_soft_float, powerpc_set_vector_abi): Constify.
* remote.c (set_remote_exec_file, set_remotebreak)
(set_remote_protocol_Z_packet_cmd, set_range_stepping): Constify.
* record.c (set_record_insn_history_size)
(set_record_call_history_size): Constify.
* record-full.c (set_record_full_insn_max_num): Constify.
* proc-api.c (set_procfs_trace_cmd, set_procfs_file_cmd): Constify.
* osabi.c (set_osabi): Constify.
* mips-tdep.c (set_mips64_transfers_32bit_regs)
(reinit_frame_cache_sfunc, mips_abi_update): Constify.
* maint.c (maintenance_set_profile_cmd): Constify.
* linux-thread-db.c (set_libthread_db_search_path): Constify.
* language.c (set_language_command, set_range_command)
(set_case_command): Constify.
* infrun.c (set_non_stop, set_observer_mode)
(set_stop_on_solib_events, set_schedlock_func)
(set_exec_direction_func): Constify.
* infcmd.c (set_inferior_tty_command): Constify.
* disasm.c (set_disassembler_options_sfunc): Constify.
* demangle.c (set_demangling_command): Constify.
* dcache.c (set_dcache_size, set_dcache_line_size): Constify.
* cris-tdep.c (set_cris_version, set_cris_mode)
(set_cris_dwarf2_cfi): Constify.
* corefile.c (set_gnutarget_command): Constify.
* charset.c (set_host_charset_sfunc, set_target_charset_sfunc)
(set_target_wide_charset_sfunc): Constify.
* breakpoint.c (update_dprintf_commands): Constify.
* auto-load.c (set_auto_load_dir, set_auto_load_safe_path): Constify.
* arm-tdep.c (set_fp_model_sfunc, arm_set_abi)
(set_disassembly_style_sfunc): Constify.
* arch-utils.c (set_endian, set_architecture): Constify.
* alpha-tdep.c (reinit_frame_cache_sfunc): Constify.
* agent.c (set_can_use_agent): Constify.

55 files changed:
gdb/ChangeLog
gdb/ada-lang.c
gdb/agent.c
gdb/alpha-tdep.c
gdb/arch-utils.c
gdb/arm-tdep.c
gdb/auto-load.c
gdb/break-catch-sig.c
gdb/break-catch-syscall.c
gdb/break-catch-throw.c
gdb/breakpoint.c
gdb/breakpoint.h
gdb/charset.c
gdb/cli/cli-decode.c
gdb/cli/cli-decode.h
gdb/cli/cli-logging.c
gdb/command.h
gdb/compile/compile.c
gdb/corefile.c
gdb/cris-tdep.c
gdb/dcache.c
gdb/demangle.c
gdb/disasm.c
gdb/guile/scm-param.c
gdb/infcmd.c
gdb/infrun.c
gdb/language.c
gdb/linux-thread-db.c
gdb/maint.c
gdb/mi/mi-main.c
gdb/mips-tdep.c
gdb/osabi.c
gdb/proc-api.c
gdb/python/py-param.c
gdb/record-full.c
gdb/record.c
gdb/remote.c
gdb/rs6000-tdep.c
gdb/serial.c
gdb/solib.c
gdb/source.c
gdb/symfile-debug.c
gdb/symfile.c
gdb/symtab.c
gdb/target-dcache.c
gdb/target-descriptions.c
gdb/target.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

index a19e628..ad03356 100644 (file)
@@ -1,5 +1,109 @@
 2017-11-07  Tom Tromey  <tom@tromey.com>
 
+       * ada-lang.c (catch_ada_exception_command): Constify.
+       (catch_assert_command): Constify.
+       * break-catch-throw.c (catch_catch_command, catch_throw_command)
+       (catch_rethrow_command): Constify.
+       (catch_exception_command_1): Constify.
+       * breakpoint.h (add_catch_command): Constify.
+       * break-catch-syscall.c (catch_syscall_command_1): Constify.
+       (catch_syscall_split_args): Constify.
+       * break-catch-sig.c (catch_signal_command): Constify.
+       (catch_signal_split_args): Constify.
+       * cli/cli-decode.h (struct cmd_list_element) <function>: Use
+       cmd_const_sfunc_ftype.
+       * cli/cli-decode.c (add_setshow_cmd_full): Constify.
+       (add_setshow_enum_cmd, add_setshow_auto_boolean_cmd)
+       (add_setshow_boolean_cmd, add_setshow_filename_cmd)
+       (add_setshow_string_cmd, struct cmd_list_element)
+       (add_setshow_optional_filename_cmd, add_setshow_integer_cmd)
+       (add_setshow_uinteger_cmd, add_setshow_zinteger_cmd)
+       (add_setshow_zuinteger_unlimited_cmd, add_setshow_zuinteger_cmd):
+       Constify.
+       (set_cmd_sfunc): Constify.
+       (empty_sfunc): Constify.
+       * command.h (add_setshow_enum_cmd, add_setshow_auto_boolean_cmd)
+       (add_setshow_boolean_cmd, add_setshow_filename_cmd)
+       (add_setshow_string_cmd, add_setshow_string_noescape_cmd)
+       (add_setshow_optional_filename_cmd, add_setshow_integer_cmd)
+       (add_setshow_uinteger_cmd, add_setshow_zinteger_cmd)
+       (add_setshow_zuinteger_cmd, add_setshow_zuinteger_unlimited_cmd):
+       Constify.
+       (set_cmd_sfunc): Constify.
+       (cmd_sfunc_ftype): Remove.
+       * compile/compile.c (set_compile_args): Constify.
+       * infrun.c (set_disable_randomization): Constify.
+       * infcmd.c (set_args_command, set_cwd_command): Constify.
+       * breakpoint.c (set_condition_evaluation_mode): Constify.
+       (add_catch_command): Constify.
+       (catch_fork_command_1, catch_exec_command_1)
+       (catch_load_command_1, catch_unload_command_1): Constify.
+       (catch_load_or_unload): Constify.
+       * guile/scm-param.c (pascm_set_func): Constify.
+       (add_setshow_generic): Constify.
+       * python/py-param.c (get_set_value): Constify.
+       * top.h (set_verbose): Constify.
+       * tui/tui-win.c (tui_set_var_cmd): Constify.
+       * mi/mi-main.c (set_mi_async_command): Constify.
+       * cli/cli-logging.c (set_logging_overwrite)
+       (set_logging_redirect): Constify.
+       * value.c (set_max_value_size): Constify.
+       * valprint.c (set_input_radix, set_output_radix): Constify.
+       * utils.c (set_width_command, set_height_command): Constify.
+       * typeprint.c (set_print_type_methods, set_print_type_typedefs): Constify.
+       * tracepoint.c (set_disconnected_tracing)
+       (set_circular_trace_buffer, set_trace_buffer_size)
+       (set_trace_user, set_trace_notes, set_trace_stop_notes): Constify.
+       * top.c (set_history_size_command, set_verbose, set_editing)
+       (set_gdb_datadir, set_history_filename): Constify.
+       * target.c (set_targetdebug, maint_set_target_async_command)
+       (maint_set_target_non_stop_command, set_target_permissions)
+       (set_write_memory_permission): Constify.
+       (open_target): Constify.
+       * target-descriptions.c (set_tdesc_filename_cmd): Constify.
+       * target-dcache.c (set_stack_cache, set_code_cache): Constify.
+       * symtab.c (set_symbol_cache_size_handler): Constify.
+       * symfile.c (set_ext_lang_command): Constify.
+       * symfile-debug.c (set_debug_symfile): Constify.
+       * source.c (set_directories_command): Constify.
+       * solib.c (reload_shared_libraries, gdb_sysroot_changed): Constify.
+       * serial.c (set_parity): Constify.
+       * rs6000-tdep.c (powerpc_set_soft_float, powerpc_set_vector_abi): Constify.
+       * remote.c (set_remote_exec_file, set_remotebreak)
+       (set_remote_protocol_Z_packet_cmd, set_range_stepping): Constify.
+       * record.c (set_record_insn_history_size)
+       (set_record_call_history_size): Constify.
+       * record-full.c (set_record_full_insn_max_num): Constify.
+       * proc-api.c (set_procfs_trace_cmd, set_procfs_file_cmd): Constify.
+       * osabi.c (set_osabi): Constify.
+       * mips-tdep.c (set_mips64_transfers_32bit_regs)
+       (reinit_frame_cache_sfunc, mips_abi_update): Constify.
+       * maint.c (maintenance_set_profile_cmd): Constify.
+       * linux-thread-db.c (set_libthread_db_search_path): Constify.
+       * language.c (set_language_command, set_range_command)
+       (set_case_command): Constify.
+       * infrun.c (set_non_stop, set_observer_mode)
+       (set_stop_on_solib_events, set_schedlock_func)
+       (set_exec_direction_func): Constify.
+       * infcmd.c (set_inferior_tty_command): Constify.
+       * disasm.c (set_disassembler_options_sfunc): Constify.
+       * demangle.c (set_demangling_command): Constify.
+       * dcache.c (set_dcache_size, set_dcache_line_size): Constify.
+       * cris-tdep.c (set_cris_version, set_cris_mode)
+       (set_cris_dwarf2_cfi): Constify.
+       * corefile.c (set_gnutarget_command): Constify.
+       * charset.c (set_host_charset_sfunc, set_target_charset_sfunc)
+       (set_target_wide_charset_sfunc): Constify.
+       * breakpoint.c (update_dprintf_commands): Constify.
+       * auto-load.c (set_auto_load_dir, set_auto_load_safe_path): Constify.
+       * arm-tdep.c (set_fp_model_sfunc, arm_set_abi)
+       (set_disassembly_style_sfunc): Constify.
+       * arch-utils.c (set_endian, set_architecture): Constify.
+       * alpha-tdep.c (reinit_frame_cache_sfunc): Constify.
+       * agent.c (set_can_use_agent): Constify.
+
+2017-11-07  Tom Tromey  <tom@tromey.com>
+
        * go32-nat.c (go32_sysinfo, go32_sldt, go32_sgdt, go32_sidt)
        (go32_pde, go32_pte, go32_pte_for_address): Constify.
        * gnu-nat.c (_parse_bool_arg, show_thread_default_pause_cmd)
index 690ed65..bc3b635 100644 (file)
@@ -12988,7 +12988,7 @@ create_ada_exception_catchpoint (struct gdbarch *gdbarch,
 /* Implement the "catch exception" command.  */
 
 static void
-catch_ada_exception_command (char *arg_entry, int from_tty,
+catch_ada_exception_command (const char *arg_entry, int from_tty,
                             struct cmd_list_element *command)
 {
   const char *arg = arg_entry;
@@ -13043,7 +13043,7 @@ catch_ada_assert_command_split (const char *args, char **cond_string)
 /* Implement the "catch assert" command.  */
 
 static void
-catch_assert_command (char *arg_entry, int from_tty,
+catch_assert_command (const char *arg_entry, int from_tty,
                      struct cmd_list_element *command)
 {
   const char *arg = arg_entry;
index c0f10aa..f04845e 100644 (file)
@@ -44,7 +44,7 @@ show_can_use_agent (struct ui_file *file, int from_tty,
 }
 
 static void
-set_can_use_agent (char *args, int from_tty, struct cmd_list_element *c)
+set_can_use_agent (const char *args, int from_tty, struct cmd_list_element *c)
 {
   if (target_use_agent (can_use_agent == can_use_agent_on) == 0)
     /* Something wrong during setting, set flag to default value.  */
index 4331422..3100d72 100644 (file)
@@ -1461,7 +1461,8 @@ static const struct frame_base alpha_heuristic_frame_base = {
    callable as an sfunc.  Used by the "set heuristic-fence-post" command.  */
 
 static void
-reinit_frame_cache_sfunc (char *args, int from_tty, struct cmd_list_element *c)
+reinit_frame_cache_sfunc (const char *args,
+                         int from_tty, struct cmd_list_element *c)
 {
   reinit_frame_cache ();
 }
index a25dcd1..6c0e0b3 100644 (file)
@@ -332,7 +332,7 @@ show_endian (struct ui_file *file, int from_tty, struct cmd_list_element *c,
 }
 
 static void
-set_endian (char *ignore_args, int from_tty, struct cmd_list_element *c)
+set_endian (const char *ignore_args, int from_tty, struct cmd_list_element *c)
 {
   struct gdbarch_info info;
 
@@ -490,7 +490,8 @@ show_architecture (struct ui_file *file, int from_tty,
    argument.  */
 
 static void
-set_architecture (char *ignore_args, int from_tty, struct cmd_list_element *c)
+set_architecture (const char *ignore_args,
+                 int from_tty, struct cmd_list_element *c)
 {
   struct gdbarch_info info;
 
index d38f2c8..54c6392 100644 (file)
@@ -220,7 +220,7 @@ static const char *disassembly_style;
 
 /* This is used to keep the bfd arch_info in sync with the disassembly
    style.  */
-static void set_disassembly_style_sfunc(char *, int,
+static void set_disassembly_style_sfunc (const char *, int,
                                         struct cmd_list_element *);
 static void show_disassembly_style_sfunc (struct ui_file *, int,
                                          struct cmd_list_element *,
@@ -8387,7 +8387,7 @@ arm_update_current_architecture (void)
 }
 
 static void
-set_fp_model_sfunc (char *args, int from_tty,
+set_fp_model_sfunc (const char *args, int from_tty,
                    struct cmd_list_element *c)
 {
   int fp_model;
@@ -8424,7 +8424,7 @@ The current ARM floating point model is \"%s\".\n"),
 }
 
 static void
-arm_set_abi (char *args, int from_tty,
+arm_set_abi (const char *args, int from_tty,
             struct cmd_list_element *c)
 {
   int arm_abi;
@@ -8485,7 +8485,7 @@ arm_show_force_mode (struct ui_file *file, int from_tty,
    arm disassembly" command, and does that.  */
 
 static void
-set_disassembly_style_sfunc (char *args, int from_tty,
+set_disassembly_style_sfunc (const char *args, int from_tty,
                             struct cmd_list_element *c)
 {
   /* Convert the short style name into the long style name (eg, reg-names-*)
index 63366df..3d56014 100644 (file)
@@ -139,7 +139,7 @@ static char *auto_load_dir;
 /* "set" command for the auto_load_dir configuration variable.  */
 
 static void
-set_auto_load_dir (char *args, int from_tty, struct cmd_list_element *c)
+set_auto_load_dir (const char *args, int from_tty, struct cmd_list_element *c)
 {
   /* Setting the variable to "" resets it to the compile time defaults.  */
   if (auto_load_dir[0] == '\0')
@@ -262,7 +262,8 @@ auto_load_gdb_datadir_changed (void)
 /* "set" command for the auto_load_safe_path configuration variable.  */
 
 static void
-set_auto_load_safe_path (char *args, int from_tty, struct cmd_list_element *c)
+set_auto_load_safe_path (const char *args,
+                        int from_tty, struct cmd_list_element *c)
 {
   /* Setting the variable to "" resets it to the compile time defaults.  */
   if (auto_load_safe_path[0] == '\0')
index 5ab7cd3..4086161 100644 (file)
@@ -332,7 +332,7 @@ create_signal_catchpoint (int tempflag, std::vector<gdb_signal> &&filter,
    list, which is empty if no filtering is required.  */
 
 static std::vector<gdb_signal>
-catch_signal_split_args (char *arg, bool *catch_all)
+catch_signal_split_args (const char *arg, bool *catch_all)
 {
   std::vector<gdb_signal> result;
   bool first = true;
@@ -381,7 +381,7 @@ catch_signal_split_args (char *arg, bool *catch_all)
 /* Implement the "catch signal" command.  */
 
 static void
-catch_signal_command (char *arg, int from_tty,
+catch_signal_command (const char *arg, int from_tty,
                      struct cmd_list_element *command)
 {
   int tempflag;
index b0ed4d2..41ea424 100644 (file)
@@ -382,7 +382,7 @@ create_syscall_event_catchpoint (int tempflag, std::vector<int> &&filter,
 /* Splits the argument using space as delimiter.  */
 
 static std::vector<int>
-catch_syscall_split_args (char *arg)
+catch_syscall_split_args (const char *arg)
 {
   std::vector<int> result;
   struct gdbarch *gdbarch = target_gdbarch ();
@@ -457,7 +457,7 @@ catch_syscall_split_args (char *arg)
 /* Implement the "catch syscall" command.  */
 
 static void
-catch_syscall_command_1 (char *arg, int from_tty, 
+catch_syscall_command_1 (const char *arg, int from_tty, 
                         struct cmd_list_element *command)
 {
   int tempflag;
index faa878e..fd8a113 100644 (file)
@@ -430,11 +430,10 @@ extract_exception_regexp (const char **string)
 
 static void
 catch_exception_command_1 (enum exception_event_kind ex_event,
-                          char *arg_entry,
+                          const char *arg,
                           int tempflag, int from_tty)
 {
   const char *cond_string = NULL;
-  const char *arg = arg_entry;
 
   if (!arg)
     arg = "";
@@ -459,7 +458,8 @@ catch_exception_command_1 (enum exception_event_kind ex_event,
 /* Implementation of "catch catch" command.  */
 
 static void
-catch_catch_command (char *arg, int from_tty, struct cmd_list_element *command)
+catch_catch_command (const char *arg, int from_tty,
+                    struct cmd_list_element *command)
 {
   int tempflag = get_cmd_context (command) == CATCH_TEMPORARY;
 
@@ -469,7 +469,8 @@ catch_catch_command (char *arg, int from_tty, struct cmd_list_element *command)
 /* Implementation of "catch throw" command.  */
 
 static void
-catch_throw_command (char *arg, int from_tty, struct cmd_list_element *command)
+catch_throw_command (const char *arg, int from_tty,
+                    struct cmd_list_element *command)
 {
   int tempflag = get_cmd_context (command) == CATCH_TEMPORARY;
 
@@ -479,7 +480,7 @@ catch_throw_command (char *arg, int from_tty, struct cmd_list_element *command)
 /* Implementation of "catch rethrow" command.  */
 
 static void
-catch_rethrow_command (char *arg, int from_tty,
+catch_rethrow_command (const char *arg, int from_tty,
                       struct cmd_list_element *command)
 {
   int tempflag = get_cmd_context (command) == CATCH_TEMPORARY;
index 0d78141..b170a14 100644 (file)
@@ -710,7 +710,7 @@ mark_breakpoint_location_modified (struct bp_location *loc)
    condition_evaluation_mode.  */
 
 static void
-set_condition_evaluation_mode (char *args, int from_tty,
+set_condition_evaluation_mode (const char *args, int from_tty,
                               struct cmd_list_element *c)
 {
   const char *old_mode, *new_mode;
@@ -8224,7 +8224,7 @@ add_solib_catchpoint (const char *arg, int is_load, int is_temp, int enabled)
    "catch unload".  */
 
 static void
-catch_load_or_unload (char *arg, int from_tty, int is_load,
+catch_load_or_unload (const char *arg, int from_tty, int is_load,
                      struct cmd_list_element *command)
 {
   int tempflag;
@@ -8236,14 +8236,14 @@ catch_load_or_unload (char *arg, int from_tty, int is_load,
 }
 
 static void
-catch_load_command_1 (char *arg, int from_tty,
+catch_load_command_1 (const char *arg, int from_tty,
                      struct cmd_list_element *command)
 {
   catch_load_or_unload (arg, from_tty, 1, command);
 }
 
 static void
-catch_unload_command_1 (char *arg, int from_tty,
+catch_unload_command_1 (const char *arg, int from_tty,
                        struct cmd_list_element *command)
 {
   catch_load_or_unload (arg, from_tty, 0, command);
@@ -8851,7 +8851,7 @@ update_dprintf_command_list (struct breakpoint *b)
    current style settings.  */
 
 static void
-update_dprintf_commands (char *args, int from_tty,
+update_dprintf_commands (const char *args, int from_tty,
                         struct cmd_list_element *c)
 {
   struct breakpoint *b;
@@ -11326,10 +11326,9 @@ typedef enum
 catch_fork_kind;
 
 static void
-catch_fork_command_1 (char *arg_entry, int from_tty,
+catch_fork_command_1 (const char *arg, int from_tty,
                      struct cmd_list_element *command)
 {
-  const char *arg = arg_entry;
   struct gdbarch *gdbarch = get_current_arch ();
   const char *cond_string = NULL;
   catch_fork_kind fork_kind;
@@ -11374,10 +11373,9 @@ catch_fork_command_1 (char *arg_entry, int from_tty,
 }
 
 static void
-catch_exec_command_1 (char *arg_entry, int from_tty,
+catch_exec_command_1 (const char *arg, int from_tty,
                      struct cmd_list_element *command)
 {
-  const char *arg = arg_entry;
   struct gdbarch *gdbarch = get_current_arch ();
   int tempflag;
   const char *cond_string = NULL;
@@ -15334,7 +15332,7 @@ static struct cmd_list_element *tcatch_cmdlist;
 
 void
 add_catch_command (const char *name, const char *docstring,
-                  cmd_sfunc_ftype *sfunc,
+                  cmd_const_sfunc_ftype *sfunc,
                   completer_ftype *completer,
                   void *user_data_catch,
                   void *user_data_tcatch)
index cf8f3f6..6406a1d 100644 (file)
@@ -1288,7 +1288,7 @@ extern void initialize_breakpoint_ops (void);
 
 extern void
   add_catch_command (const char *name, const char *docstring,
-                    cmd_sfunc_ftype *sfunc,
+                    cmd_const_sfunc_ftype *sfunc,
                     completer_ftype *completer,
                     void *user_data_catch,
                     void *user_data_tcatch);
index cc74331..709a314 100644 (file)
@@ -365,7 +365,7 @@ validate (struct gdbarch *gdbarch)
 
 /* This is the sfunc for the 'set charset' command.  */
 static void
-set_charset_sfunc (char *charset, int from_tty, 
+set_charset_sfunc (const char *charset, int from_tty, 
                   struct cmd_list_element *c)
 {
   /* CAREFUL: set the target charset here as well.  */
@@ -376,7 +376,7 @@ set_charset_sfunc (char *charset, int from_tty,
 /* 'set host-charset' command sfunc.  We need a wrapper here because
    the function needs to have a specific signature.  */
 static void
-set_host_charset_sfunc (char *charset, int from_tty,
+set_host_charset_sfunc (const char *charset, int from_tty,
                        struct cmd_list_element *c)
 {
   validate (get_current_arch ());
@@ -384,7 +384,7 @@ set_host_charset_sfunc (char *charset, int from_tty,
 
 /* Wrapper for the 'set target-charset' command.  */
 static void
-set_target_charset_sfunc (char *charset, int from_tty,
+set_target_charset_sfunc (const char *charset, int from_tty,
                          struct cmd_list_element *c)
 {
   validate (get_current_arch ());
@@ -392,7 +392,7 @@ set_target_charset_sfunc (char *charset, int from_tty,
 
 /* Wrapper for the 'set target-wide-charset' command.  */
 static void
-set_target_wide_charset_sfunc (char *charset, int from_tty,
+set_target_wide_charset_sfunc (const char *charset, int from_tty,
                               struct cmd_list_element *c)
 {
   validate (get_current_arch ());
index 459438e..c3e7228 100644 (file)
@@ -123,7 +123,7 @@ do_sfunc (struct cmd_list_element *c, char *args, int from_tty)
 }
 
 void
-set_cmd_sfunc (struct cmd_list_element *cmd, cmd_sfunc_ftype *sfunc)
+set_cmd_sfunc (struct cmd_list_element *cmd, cmd_const_sfunc_ftype *sfunc)
 {
   if (sfunc == NULL)
     cmd->func = NULL;
@@ -414,10 +414,9 @@ not_just_help_class_command (const char *args, int from_tty)
 }
 
 /* This is an empty "sfunc".  */
-static void empty_sfunc (char *, int, struct cmd_list_element *);
 
 static void
-empty_sfunc (char *args, int from_tty, struct cmd_list_element *c)
+empty_sfunc (const char *args, int from_tty, struct cmd_list_element *c)
 {
 }
 
@@ -465,7 +464,7 @@ add_setshow_cmd_full (const char *name,
                      var_types var_type, void *var,
                      const char *set_doc, const char *show_doc,
                      const char *help_doc,
-                     cmd_sfunc_ftype *set_func,
+                     cmd_const_sfunc_ftype *set_func,
                      show_value_ftype *show_func,
                      struct cmd_list_element **set_list,
                      struct cmd_list_element **show_list,
@@ -520,7 +519,7 @@ add_setshow_enum_cmd (const char *name,
                      const char *set_doc,
                      const char *show_doc,
                      const char *help_doc,
-                     cmd_sfunc_ftype *set_func,
+                     cmd_const_sfunc_ftype *set_func,
                      show_value_ftype *show_func,
                      struct cmd_list_element **set_list,
                      struct cmd_list_element **show_list)
@@ -547,7 +546,7 @@ add_setshow_auto_boolean_cmd (const char *name,
                              enum auto_boolean *var,
                              const char *set_doc, const char *show_doc,
                              const char *help_doc,
-                             cmd_sfunc_ftype *set_func,
+                             cmd_const_sfunc_ftype *set_func,
                              show_value_ftype *show_func,
                              struct cmd_list_element **set_list,
                              struct cmd_list_element **show_list)
@@ -570,7 +569,7 @@ void
 add_setshow_boolean_cmd (const char *name, enum command_class theclass, int *var,
                         const char *set_doc, const char *show_doc,
                         const char *help_doc,
-                        cmd_sfunc_ftype *set_func,
+                        cmd_const_sfunc_ftype *set_func,
                         show_value_ftype *show_func,
                         struct cmd_list_element **set_list,
                         struct cmd_list_element **show_list)
@@ -593,7 +592,7 @@ add_setshow_filename_cmd (const char *name, enum command_class theclass,
                          char **var,
                          const char *set_doc, const char *show_doc,
                          const char *help_doc,
-                         cmd_sfunc_ftype *set_func,
+                         cmd_const_sfunc_ftype *set_func,
                          show_value_ftype *show_func,
                          struct cmd_list_element **set_list,
                          struct cmd_list_element **show_list)
@@ -615,7 +614,7 @@ add_setshow_string_cmd (const char *name, enum command_class theclass,
                        char **var,
                        const char *set_doc, const char *show_doc,
                        const char *help_doc,
-                       cmd_sfunc_ftype *set_func,
+                       cmd_const_sfunc_ftype *set_func,
                        show_value_ftype *show_func,
                        struct cmd_list_element **set_list,
                        struct cmd_list_element **show_list)
@@ -634,7 +633,7 @@ add_setshow_string_noescape_cmd (const char *name, enum command_class theclass,
                                 char **var,
                                 const char *set_doc, const char *show_doc,
                                 const char *help_doc,
-                                cmd_sfunc_ftype *set_func,
+                                cmd_const_sfunc_ftype *set_func,
                                 show_value_ftype *show_func,
                                 struct cmd_list_element **set_list,
                                 struct cmd_list_element **show_list)
@@ -656,7 +655,7 @@ add_setshow_optional_filename_cmd (const char *name, enum command_class theclass
                                   char **var,
                                   const char *set_doc, const char *show_doc,
                                   const char *help_doc,
-                                  cmd_sfunc_ftype *set_func,
+                                  cmd_const_sfunc_ftype *set_func,
                                   show_value_ftype *show_func,
                                   struct cmd_list_element **set_list,
                                   struct cmd_list_element **show_list)
@@ -700,7 +699,7 @@ add_setshow_integer_cmd (const char *name, enum command_class theclass,
                         int *var,
                         const char *set_doc, const char *show_doc,
                         const char *help_doc,
-                        cmd_sfunc_ftype *set_func,
+                        cmd_const_sfunc_ftype *set_func,
                         show_value_ftype *show_func,
                         struct cmd_list_element **set_list,
                         struct cmd_list_element **show_list)
@@ -725,7 +724,7 @@ add_setshow_uinteger_cmd (const char *name, enum command_class theclass,
                          unsigned int *var,
                          const char *set_doc, const char *show_doc,
                          const char *help_doc,
-                         cmd_sfunc_ftype *set_func,
+                         cmd_const_sfunc_ftype *set_func,
                          show_value_ftype *show_func,
                          struct cmd_list_element **set_list,
                          struct cmd_list_element **show_list)
@@ -750,7 +749,7 @@ add_setshow_zinteger_cmd (const char *name, enum command_class theclass,
                          int *var,
                          const char *set_doc, const char *show_doc,
                          const char *help_doc,
-                         cmd_sfunc_ftype *set_func,
+                         cmd_const_sfunc_ftype *set_func,
                          show_value_ftype *show_func,
                          struct cmd_list_element **set_list,
                          struct cmd_list_element **show_list)
@@ -769,7 +768,7 @@ add_setshow_zuinteger_unlimited_cmd (const char *name,
                                     const char *set_doc,
                                     const char *show_doc,
                                     const char *help_doc,
-                                    cmd_sfunc_ftype *set_func,
+                                    cmd_const_sfunc_ftype *set_func,
                                     show_value_ftype *show_func,
                                     struct cmd_list_element **set_list,
                                     struct cmd_list_element **show_list)
@@ -794,7 +793,7 @@ add_setshow_zuinteger_cmd (const char *name, enum command_class theclass,
                           unsigned int *var,
                           const char *set_doc, const char *show_doc,
                           const char *help_doc,
-                          cmd_sfunc_ftype *set_func,
+                          cmd_const_sfunc_ftype *set_func,
                           show_value_ftype *show_func,
                           struct cmd_list_element **set_list,
                           struct cmd_list_element **show_list)
index e3ac69b..9b2d598 100644 (file)
@@ -116,7 +116,7 @@ struct cmd_list_element
        cmd_const_cfunc_ftype *const_cfunc;
        /* If type is set_cmd or show_cmd, first set the variables,
           and then call this: */
-       cmd_sfunc_ftype *sfunc;
+       cmd_const_sfunc_ftype *sfunc;
       }
     function;
 
index ee31659..8e86ce7 100644 (file)
@@ -44,7 +44,8 @@ maybe_warn_already_logging ()
 }
 
 static void
-set_logging_overwrite (char *args, int from_tty, struct cmd_list_element *c)
+set_logging_overwrite (const char *args,
+                      int from_tty, struct cmd_list_element *c)
 {
   maybe_warn_already_logging ();
 }
@@ -63,7 +64,8 @@ show_logging_overwrite (struct ui_file *file, int from_tty,
 static int logging_redirect;
 
 static void
-set_logging_redirect (char *args, int from_tty, struct cmd_list_element *c)
+set_logging_redirect (const char *args,
+                     int from_tty, struct cmd_list_element *c)
 {
   maybe_warn_already_logging ();
 }
index cbcf523..69e903f 100644 (file)
@@ -174,10 +174,10 @@ extern struct cmd_list_element *add_abbrev_prefix_cmd (const char *,
                                                       struct cmd_list_element
                                                       **);
 
-typedef void cmd_sfunc_ftype (char *args, int from_tty,
-                             struct cmd_list_element *c);
+typedef void cmd_const_sfunc_ftype (const char *args, int from_tty,
+                                   struct cmd_list_element *c);
 extern void set_cmd_sfunc (struct cmd_list_element *cmd,
-                          cmd_sfunc_ftype *sfunc);
+                          cmd_const_sfunc_ftype *sfunc);
 
 /* A completion routine.  Add possible completions to tracker.
 
@@ -297,7 +297,7 @@ extern void add_setshow_enum_cmd (const char *name,
                                  const char *set_doc,
                                  const char *show_doc,
                                  const char *help_doc,
-                                 cmd_sfunc_ftype *set_func,
+                                 cmd_const_sfunc_ftype *set_func,
                                  show_value_ftype *show_func,
                                  struct cmd_list_element **set_list,
                                  struct cmd_list_element **show_list);
@@ -308,7 +308,7 @@ extern void add_setshow_auto_boolean_cmd (const char *name,
                                          const char *set_doc,
                                          const char *show_doc,
                                          const char *help_doc,
-                                         cmd_sfunc_ftype *set_func,
+                                         cmd_const_sfunc_ftype *set_func,
                                          show_value_ftype *show_func,
                                          struct cmd_list_element **set_list,
                                          struct cmd_list_element **show_list);
@@ -318,7 +318,7 @@ extern void add_setshow_boolean_cmd (const char *name,
                                     int *var,
                                     const char *set_doc, const char *show_doc,
                                     const char *help_doc,
-                                    cmd_sfunc_ftype *set_func,
+                                    cmd_const_sfunc_ftype *set_func,
                                     show_value_ftype *show_func,
                                     struct cmd_list_element **set_list,
                                     struct cmd_list_element **show_list);
@@ -329,7 +329,7 @@ extern void add_setshow_filename_cmd (const char *name,
                                      const char *set_doc,
                                      const char *show_doc,
                                      const char *help_doc,
-                                     cmd_sfunc_ftype *set_func,
+                                     cmd_const_sfunc_ftype *set_func,
                                      show_value_ftype *show_func,
                                      struct cmd_list_element **set_list,
                                      struct cmd_list_element **show_list);
@@ -340,7 +340,7 @@ extern void add_setshow_string_cmd (const char *name,
                                    const char *set_doc,
                                    const char *show_doc,
                                    const char *help_doc,
-                                   cmd_sfunc_ftype *set_func,
+                                   cmd_const_sfunc_ftype *set_func,
                                    show_value_ftype *show_func,
                                    struct cmd_list_element **set_list,
                                    struct cmd_list_element **show_list);
@@ -352,7 +352,7 @@ extern struct cmd_list_element *add_setshow_string_noescape_cmd
                       const char *set_doc,
                       const char *show_doc,
                       const char *help_doc,
-                      cmd_sfunc_ftype *set_func,
+                      cmd_const_sfunc_ftype *set_func,
                       show_value_ftype *show_func,
                       struct cmd_list_element **set_list,
                       struct cmd_list_element **show_list);
@@ -363,7 +363,7 @@ extern void add_setshow_optional_filename_cmd (const char *name,
                                               const char *set_doc,
                                               const char *show_doc,
                                               const char *help_doc,
-                                              cmd_sfunc_ftype *set_func,
+                                              cmd_const_sfunc_ftype *set_func,
                                               show_value_ftype *show_func,
                                               struct cmd_list_element **set_list,
                                               struct cmd_list_element **show_list);
@@ -374,7 +374,7 @@ extern void add_setshow_integer_cmd (const char *name,
                                     const char *set_doc,
                                     const char *show_doc,
                                     const char *help_doc,
-                                    cmd_sfunc_ftype *set_func,
+                                    cmd_const_sfunc_ftype *set_func,
                                     show_value_ftype *show_func,
                                     struct cmd_list_element **set_list,
                                     struct cmd_list_element **show_list);
@@ -385,7 +385,7 @@ extern void add_setshow_uinteger_cmd (const char *name,
                                      const char *set_doc,
                                      const char *show_doc,
                                      const char *help_doc,
-                                     cmd_sfunc_ftype *set_func,
+                                     cmd_const_sfunc_ftype *set_func,
                                      show_value_ftype *show_func,
                                      struct cmd_list_element **set_list,
                                      struct cmd_list_element **show_list);
@@ -396,7 +396,7 @@ extern void add_setshow_zinteger_cmd (const char *name,
                                      const char *set_doc,
                                      const char *show_doc,
                                      const char *help_doc,
-                                     cmd_sfunc_ftype *set_func,
+                                     cmd_const_sfunc_ftype *set_func,
                                      show_value_ftype *show_func,
                                      struct cmd_list_element **set_list,
                                      struct cmd_list_element **show_list);
@@ -407,7 +407,7 @@ extern void add_setshow_zuinteger_cmd (const char *name,
                                       const char *set_doc,
                                       const char *show_doc,
                                       const char *help_doc,
-                                      cmd_sfunc_ftype *set_func,
+                                      cmd_const_sfunc_ftype *set_func,
                                       show_value_ftype *show_func,
                                       struct cmd_list_element **set_list,
                                       struct cmd_list_element **show_list);
@@ -419,7 +419,7 @@ extern void
                                       const char *set_doc,
                                       const char *show_doc,
                                       const char *help_doc,
-                                      cmd_sfunc_ftype *set_func,
+                                      cmd_const_sfunc_ftype *set_func,
                                       show_value_ftype *show_func,
                                       struct cmd_list_element **set_list,
                                       struct cmd_list_element **show_list);
index cd8ce6a..9de244a 100644 (file)
@@ -302,7 +302,7 @@ static char **compile_args_argv;
 /* Implement 'set compile-args'.  */
 
 static void
-set_compile_args (char *args, int from_tty, struct cmd_list_element *c)
+set_compile_args (const char *args, int from_tty, struct cmd_list_element *c)
 {
   freeargv (compile_args_argv);
   build_argc_argv (compile_args, &compile_args_argc, &compile_args_argv);
index b9d95c0..686603a 100644 (file)
@@ -452,11 +452,8 @@ show_gnutarget_string (struct ui_file *file, int from_tty,
                    _("The current BFD target is \"%s\".\n"), value);
 }
 
-static void set_gnutarget_command (char *, int,
-                                  struct cmd_list_element *);
-
 static void
-set_gnutarget_command (char *ignore, int from_tty,
+set_gnutarget_command (const char *ignore, int from_tty,
                       struct cmd_list_element *c)
 {
   char *gend = gnutarget_string + strlen (gnutarget_string);
index 416843f..9fbb8b4 100644 (file)
@@ -634,13 +634,13 @@ static struct gdbarch *cris_gdbarch_init (struct gdbarch_info,
 
 static void cris_dump_tdep (struct gdbarch *, struct ui_file *);
 
-static void set_cris_version (char *ignore_args, int from_tty, 
+static void set_cris_version (const char *ignore_args, int from_tty, 
                              struct cmd_list_element *c);
 
-static void set_cris_mode (char *ignore_args, int from_tty, 
+static void set_cris_mode (const char *ignore_args, int from_tty, 
                           struct cmd_list_element *c);
 
-static void set_cris_dwarf2_cfi (char *ignore_args, int from_tty, 
+static void set_cris_dwarf2_cfi (const char *ignore_args, int from_tty, 
                                 struct cmd_list_element *c);
 
 static CORE_ADDR cris_scan_prologue (CORE_ADDR pc, 
@@ -3926,7 +3926,7 @@ cris_dump_tdep (struct gdbarch *gdbarch, struct ui_file *file)
 }
 
 static void
-set_cris_version (char *ignore_args, int from_tty, 
+set_cris_version (const char *ignore_args, int from_tty, 
                  struct cmd_list_element *c)
 {
   struct gdbarch_info info;
@@ -3941,7 +3941,7 @@ set_cris_version (char *ignore_args, int from_tty,
 }
 
 static void
-set_cris_mode (char *ignore_args, int from_tty, 
+set_cris_mode (const char *ignore_args, int from_tty, 
               struct cmd_list_element *c)
 {
   struct gdbarch_info info;
@@ -3954,7 +3954,7 @@ set_cris_mode (char *ignore_args, int from_tty,
 }
 
 static void
-set_cris_dwarf2_cfi (char *ignore_args, int from_tty, 
+set_cris_dwarf2_cfi (const char *ignore_args, int from_tty, 
                     struct cmd_list_element *c)
 {
   struct gdbarch_info info;
index e7b1e14..740438f 100644 (file)
@@ -644,7 +644,7 @@ info_dcache_command (const char *exp, int tty)
 }
 
 static void
-set_dcache_size (char *args, int from_tty,
+set_dcache_size (const char *args, int from_tty,
                 struct cmd_list_element *c)
 {
   if (dcache_size == 0)
@@ -656,7 +656,7 @@ set_dcache_size (char *args, int from_tty,
 }
 
 static void
-set_dcache_line_size (char *args, int from_tty,
+set_dcache_line_size (const char *args, int from_tty,
                      struct cmd_list_element *c)
 {
   if (dcache_line_size < 2
index 1a97fb7..696f214 100644 (file)
@@ -104,7 +104,8 @@ show_demangling_style_names(struct ui_file *file, int from_tty,
    a malloc'd string, even if it is a null-string.  */
 
 static void
-set_demangling_command (char *ignore, int from_tty, struct cmd_list_element *c)
+set_demangling_command (const char *ignore,
+                       int from_tty, struct cmd_list_element *c)
 {
   const struct demangler_engine *dem;
   int i;
index ab23384..4b2c8e6 100644 (file)
@@ -938,7 +938,7 @@ set_disassembler_options (char *prospective_options)
 }
 
 static void
-set_disassembler_options_sfunc (char *args, int from_tty,
+set_disassembler_options_sfunc (const char *args, int from_tty,
                                struct cmd_list_element *c)
 {
   set_disassembler_options (prospective_options);
index ab00fd9..9478778 100644 (file)
@@ -269,7 +269,7 @@ pascm_signal_setshow_error (SCM exception, const char *msg)
    Note: ARGS is always passed as NULL.  */
 
 static void
-pascm_set_func (char *args, int from_tty, struct cmd_list_element *c)
+pascm_set_func (const char *args, int from_tty, struct cmd_list_element *c)
 {
   param_smob *p_smob = (param_smob *) get_cmd_context (c);
   SCM self, result, exception;
@@ -357,7 +357,7 @@ static void
 add_setshow_generic (enum var_types param_type, enum command_class cmd_class,
                     char *cmd_name, param_smob *self,
                     char *set_doc, char *show_doc, char *help_doc,
-                    cmd_sfunc_ftype *set_func,
+                    cmd_const_sfunc_ftype *set_func,
                     show_value_ftype *show_func,
                     struct cmd_list_element **set_list,
                     struct cmd_list_element **show_list,
index 07dbdfe..9cee174 100644 (file)
@@ -134,7 +134,7 @@ get_inferior_io_terminal (void)
 }
 
 static void
-set_inferior_tty_command (char *args, int from_tty,
+set_inferior_tty_command (const char *args, int from_tty,
                          struct cmd_list_element *c)
 {
   /* CLI has assigned the user-provided value to inferior_io_terminal_scratch.
@@ -198,7 +198,7 @@ set_inferior_args_vector (int argc, char **argv)
 /* Notice when `set args' is run.  */
 
 static void
-set_args_command (char *args, int from_tty, struct cmd_list_element *c)
+set_args_command (const char *args, int from_tty, struct cmd_list_element *c)
 {
   /* CLI has assigned the user-provided value to inferior_args_scratch.
      Now route it to current inferior.  */
@@ -242,7 +242,7 @@ get_inferior_cwd ()
 /* Handle the 'set cwd' command.  */
 
 static void
-set_cwd_command (char *args, int from_tty, struct cmd_list_element *c)
+set_cwd_command (const char *args, int from_tty, struct cmd_list_element *c)
 {
   if (*inferior_cwd_scratch == '\0')
     set_inferior_cwd (NULL);
index 4bf21c0..e2d1248 100644 (file)
@@ -82,9 +82,6 @@ static int follow_fork_inferior (int follow_child, int detach_fork);
 
 static void follow_inferior_reset_breakpoints (void);
 
-static void set_schedlock_func (char *args, int from_tty,
-                               struct cmd_list_element *c);
-
 static int currently_stepping (struct thread_info *tp);
 
 void nullify_last_target_wait_ptid (void);
@@ -195,7 +192,7 @@ show_disable_randomization (struct ui_file *file, int from_tty,
 }
 
 static void
-set_disable_randomization (char *args, int from_tty,
+set_disable_randomization (const char *args, int from_tty,
                           struct cmd_list_element *c)
 {
   if (!target_supports_disable_randomization ())
@@ -210,7 +207,7 @@ int non_stop = 0;
 static int non_stop_1 = 0;
 
 static void
-set_non_stop (char *args, int from_tty,
+set_non_stop (const char *args, int from_tty,
              struct cmd_list_element *c)
 {
   if (target_has_execution)
@@ -239,7 +236,7 @@ int observer_mode = 0;
 static int observer_mode_1 = 0;
 
 static void
-set_observer_mode (char *args, int from_tty,
+set_observer_mode (const char *args, int from_tty,
                   struct cmd_list_element *c)
 {
   if (target_has_execution)
@@ -364,7 +361,8 @@ int stop_on_solib_events;
    as appropriate when the above flag is changed.  */
 
 static void
-set_stop_on_solib_events (char *args, int from_tty, struct cmd_list_element *c)
+set_stop_on_solib_events (const char *args,
+                         int from_tty, struct cmd_list_element *c)
 {
   update_solib_breakpoints ();
 }
@@ -2229,7 +2227,7 @@ show_scheduler_mode (struct ui_file *file, int from_tty,
 }
 
 static void
-set_schedlock_func (char *args, int from_tty, struct cmd_list_element *c)
+set_schedlock_func (const char *args, int from_tty, struct cmd_list_element *c)
 {
   if (!target_can_lock_scheduler)
     {
@@ -9096,7 +9094,7 @@ static const char *const exec_direction_names[] = {
 };
 
 static void
-set_exec_direction_func (char *args, int from_tty,
+set_exec_direction_func (const char *args, int from_tty,
                         struct cmd_list_element *cmd)
 {
   if (target_can_execute_reverse)
index ecdf431..e67f9ae 100644 (file)
@@ -155,7 +155,8 @@ show_language_command (struct ui_file *file, int from_tty,
 
 /* Set command.  Change the current working language.  */
 static void
-set_language_command (char *ignore, int from_tty, struct cmd_list_element *c)
+set_language_command (const char *ignore,
+                     int from_tty, struct cmd_list_element *c)
 {
   enum language flang = language_unknown;
 
@@ -252,7 +253,8 @@ show_range_command (struct ui_file *file, int from_tty,
 
 /* Set command.  Change the setting for range checking.  */
 static void
-set_range_command (char *ignore, int from_tty, struct cmd_list_element *c)
+set_range_command (const char *ignore,
+                  int from_tty, struct cmd_list_element *c)
 {
   if (strcmp (range, "on") == 0)
     {
@@ -326,7 +328,7 @@ show_case_command (struct ui_file *file, int from_tty,
 /* Set command.  Change the setting for case sensitivity.  */
 
 static void
-set_case_command (char *ignore, int from_tty, struct cmd_list_element *c)
+set_case_command (const char *ignore, int from_tty, struct cmd_list_element *c)
 {
    if (strcmp (case_sensitive, "on") == 0)
      {
index 1acb6ce..ea032fc 100644 (file)
@@ -92,7 +92,7 @@ show_auto_load_thread_db (struct ui_file *file, int from_tty,
 }
 
 static void
-set_libthread_db_search_path (char *ignored, int from_tty,
+set_libthread_db_search_path (const char *ignored, int from_tty,
                              struct cmd_list_element *c)
 {
   if (*libthread_db_search_path == '\0')
index 94293d5..34b0462 100644 (file)
@@ -684,7 +684,7 @@ EXTERN_C void monstartup (unsigned long, unsigned long);
 extern int main ();
 
 static void
-maintenance_set_profile_cmd (char *args, int from_tty,
+maintenance_set_profile_cmd (const char *args, int from_tty,
                             struct cmd_list_element *c)
 {
   if (maintenance_profile_p == profiling_state)
@@ -715,7 +715,7 @@ maintenance_set_profile_cmd (char *args, int from_tty,
 }
 #else
 static void
-maintenance_set_profile_cmd (char *args, int from_tty,
+maintenance_set_profile_cmd (const char *args, int from_tty,
                             struct cmd_list_element *c)
 {
   error (_("Profiling support is not available on this system."));
index 480d2fd..d875d80 100644 (file)
@@ -108,7 +108,7 @@ static int mi_async = 0;
 static int mi_async_1 = 0;
 
 static void
-set_mi_async_command (char *args, int from_tty,
+set_mi_async_command (const char *args, int from_tty,
                      struct cmd_list_element *c)
 {
   if (have_live_inferiors ())
index 039b541..830535f 100644 (file)
@@ -556,8 +556,6 @@ mips2_fp_compat (struct frame_info *frame)
 
 static CORE_ADDR heuristic_proc_start (struct gdbarch *, CORE_ADDR);
 
-static void reinit_frame_cache_sfunc (char *, int, struct cmd_list_element *);
-
 /* The list of available "set mips " and "show mips " commands.  */
 
 static struct cmd_list_element *setmipscmdlist = NULL;
@@ -855,7 +853,7 @@ static int heuristic_fence_post = 0;
 static int mips64_transfers_32bit_regs_p = 0;
 
 static void
-set_mips64_transfers_32bit_regs (char *args, int from_tty,
+set_mips64_transfers_32bit_regs (const char *args, int from_tty,
                                 struct cmd_list_element *c)
 {
   struct gdbarch_info info;
@@ -6972,7 +6970,7 @@ set_mipsfpu_auto_command (const char *args, int from_tty)
    callable as an sfunc.  */
 
 static void
-reinit_frame_cache_sfunc (char *args, int from_tty,
+reinit_frame_cache_sfunc (const char *args, int from_tty,
                          struct cmd_list_element *c)
 {
   reinit_frame_cache ();
@@ -8829,7 +8827,8 @@ mips_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 }
 
 static void
-mips_abi_update (char *ignore_args, int from_tty, struct cmd_list_element *c)
+mips_abi_update (const char *ignore_args,
+                int from_tty, struct cmd_list_element *c)
 {
   struct gdbarch_info info;
 
index b4850bc..9f3fe3c 100644 (file)
@@ -592,7 +592,7 @@ generic_elf_osabi_sniffer (bfd *abfd)
 }
 \f
 static void
-set_osabi (char *args, int from_tty, struct cmd_list_element *c)
+set_osabi (const char *args, int from_tty, struct cmd_list_element *c)
 {
   struct gdbarch_info info;
 
index 2198b26..a03caa1 100644 (file)
@@ -71,7 +71,8 @@ prepare_to_trace (void)
 }
 
 static void
-set_procfs_trace_cmd (char *args, int from_tty, struct cmd_list_element *c)
+set_procfs_trace_cmd (const char *args,
+                     int from_tty, struct cmd_list_element *c)
 {
 #if 0  /* not sure what I might actually need to do here, if anything */
   if (procfs_file)
@@ -80,7 +81,8 @@ set_procfs_trace_cmd (char *args, int from_tty, struct cmd_list_element *c)
 }
 
 static void
-set_procfs_file_cmd (char *args, int from_tty, struct cmd_list_element *c)
+set_procfs_file_cmd (const char *args,
+                    int from_tty, struct cmd_list_element *c)
 {
   /* Just changed the filename for procfs tracing.
      If a file was already open, close it.  */
index 455c99e..3f8d4e3 100644 (file)
@@ -357,7 +357,7 @@ call_doc_function (PyObject *obj, PyObject *method, PyObject *arg)
    neither exist, insert a string indicating the Parameter is not
    documented.  */
 static void
-get_set_value (char *args, int from_tty,
+get_set_value (const char *args, int from_tty,
               struct cmd_list_element *c)
 {
   PyObject *obj = (PyObject *) get_cmd_context (c);
index 6fc29d6..4249c04 100644 (file)
@@ -2760,7 +2760,7 @@ cmd_record_full_start (const char *args, int from_tty)
 }
 
 static void
-set_record_full_insn_max_num (char *args, int from_tty,
+set_record_full_insn_max_num (const char *args, int from_tty,
                              struct cmd_list_element *c)
 {
   if (record_full_insn_num > record_full_insn_max_num)
index d1d7541..8de871a 100644 (file)
@@ -759,7 +759,7 @@ validate_history_size (unsigned int *command_var, unsigned int *setting)
    [0..UINT_MAX].  See command_size_to_target_size.  */
 
 static void
-set_record_insn_history_size (char *args, int from_tty,
+set_record_insn_history_size (const char *args, int from_tty,
                              struct cmd_list_element *c)
 {
   validate_history_size (&record_insn_history_size_setshow_var,
@@ -771,7 +771,7 @@ set_record_insn_history_size (char *args, int from_tty,
    [0..UINT_MAX].  See command_size_to_target_size.  */
 
 static void
-set_record_call_history_size (char *args, int from_tty,
+set_record_call_history_size (const char *args, int from_tty,
                              struct cmd_list_element *c)
 {
   validate_history_size (&record_call_history_size_setshow_var,
index 62b87c4..3bf0596 100644 (file)
@@ -718,7 +718,7 @@ set_pspace_remote_exec_file (struct program_space *pspace,
 /* The "set/show remote exec-file" set command hook.  */
 
 static void
-set_remote_exec_file (char *ignored, int from_tty,
+set_remote_exec_file (const char *ignored, int from_tty,
                      struct cmd_list_element *c)
 {
   gdb_assert (remote_exec_file_var != NULL);
@@ -979,7 +979,7 @@ static int interrupt_on_connect = 0;
 static int remote_break;
 
 static void
-set_remotebreak (char *args, int from_tty, struct cmd_list_element *c)
+set_remotebreak (const char *args, int from_tty, struct cmd_list_element *c)
 {
   if (remote_break)
     interrupt_sequence_mode = interrupt_sequence_break;
@@ -1608,7 +1608,7 @@ enum Z_packet_type
 static enum auto_boolean remote_Z_packet_detect;
 
 static void
-set_remote_protocol_Z_packet_cmd (char *args, int from_tty,
+set_remote_protocol_Z_packet_cmd (const char *args, int from_tty,
                                  struct cmd_list_element *c)
 {
   int i;
@@ -13990,7 +13990,7 @@ show_range_stepping (struct ui_file *file, int from_tty,
 /* The "set/show range-stepping" set hook.  */
 
 static void
-set_range_stepping (char *ignore_args, int from_tty,
+set_range_stepping (const char *ignore_args, int from_tty,
                    struct cmd_list_element *c)
 {
   struct remote_state *rs = get_remote_state ();
index e3e659e..6c44995 100644 (file)
@@ -6634,7 +6634,7 @@ show_powerpc_command (const char *args, int from_tty)
 }
 
 static void
-powerpc_set_soft_float (char *args, int from_tty,
+powerpc_set_soft_float (const char *args, int from_tty,
                        struct cmd_list_element *c)
 {
   struct gdbarch_info info;
@@ -6646,7 +6646,7 @@ powerpc_set_soft_float (char *args, int from_tty,
 }
 
 static void
-powerpc_set_vector_abi (char *args, int from_tty,
+powerpc_set_vector_abi (const char *args, int from_tty,
                        struct cmd_list_element *c)
 {
   struct gdbarch_info info;
index 32d4f5a..a2895d2 100644 (file)
@@ -661,7 +661,7 @@ static const char *parity = parity_none;
 /* Set serial_parity value.  */
 
 static void
-set_parity (char *ignore_args, int from_tty, struct cmd_list_element *c)
+set_parity (const char *ignore_args, int from_tty, struct cmd_list_element *c)
 {
   if (parity == parity_odd)
     serial_parity = GDBPARITY_ODD;
index b63bb9d..cb7a5c0 100644 (file)
@@ -1369,7 +1369,7 @@ reload_shared_libraries_1 (int from_tty)
 }
 
 static void
-reload_shared_libraries (char *ignored, int from_tty,
+reload_shared_libraries (const char *ignored, int from_tty,
                         struct cmd_list_element *e)
 {
   const struct target_so_ops *ops;
@@ -1424,7 +1424,7 @@ reload_shared_libraries (char *ignored, int from_tty,
    at the start of gdb_sysroot with "target:".  */
 
 static void
-gdb_sysroot_changed (char *ignored, int from_tty,
+gdb_sysroot_changed (const char *ignored, int from_tty,
                     struct cmd_list_element *e)
 {
   const char *old_prefix = "remote:";
index b0bb482..d9d3da0 100644 (file)
@@ -314,7 +314,8 @@ select_source_symtab (struct symtab *s)
    path list.  The theory is that set(show(dir)) should be a no-op.  */
 
 static void
-set_directories_command (char *args, int from_tty, struct cmd_list_element *c)
+set_directories_command (const char *args,
+                        int from_tty, struct cmd_list_element *c)
 {
   /* This is the value that was set.
      It needs to be processed to maintain $cdir:$cwd and remove dups.  */
index 32dafa8..d67985f 100644 (file)
@@ -645,7 +645,7 @@ objfile_set_sym_fns (struct objfile *objfile, const struct sym_fns *sf)
 }
 
 static void
-set_debug_symfile (char *args, int from_tty, struct cmd_list_element *c)
+set_debug_symfile (const char *args, int from_tty, struct cmd_list_element *c)
 {
   struct program_space *pspace;
   struct objfile *objfile;
index c29ab8e..71fa09b 100644 (file)
@@ -2661,7 +2661,8 @@ show_ext_args (struct ui_file *file, int from_tty,
 }
 
 static void
-set_ext_lang_command (char *args, int from_tty, struct cmd_list_element *e)
+set_ext_lang_command (const char *args,
+                     int from_tty, struct cmd_list_element *e)
 {
   char *cp = ext_args;
   enum language lang;
index 1df980a..0c24f2b 100644 (file)
@@ -1256,7 +1256,7 @@ set_symbol_cache_size (unsigned int new_size)
 /* Called when symbol-cache-size is set.  */
 
 static void
-set_symbol_cache_size_handler (char *args, int from_tty,
+set_symbol_cache_size_handler (const char *args, int from_tty,
                               struct cmd_list_element *c)
 {
   if (new_symbol_cache_size > MAX_SYMBOL_CACHE_SIZE)
index 7602440..3759866 100644 (file)
@@ -105,7 +105,7 @@ static int stack_cache_enabled = 1;
    except cleanliness.  */
 
 static void
-set_stack_cache (char *args, int from_tty, struct cmd_list_element *c)
+set_stack_cache (const char *args, int from_tty, struct cmd_list_element *c)
 {
   if (stack_cache_enabled != stack_cache_enabled_1)
     target_dcache_invalidate ();
@@ -143,7 +143,7 @@ static int code_cache_enabled = 1;
    except cleanliness.  */
 
 static void
-set_code_cache (char *args, int from_tty, struct cmd_list_element *c)
+set_code_cache (const char *args, int from_tty, struct cmd_list_element *c)
 {
   if (code_cache_enabled != code_cache_enabled_1)
     target_dcache_invalidate ();
index 4f5e9d6..3a5999c 100644 (file)
@@ -1874,7 +1874,7 @@ unset_tdesc_cmd (const char *args, int from_tty)
 }
 
 static void
-set_tdesc_filename_cmd (char *args, int from_tty,
+set_tdesc_filename_cmd (const char *args, int from_tty,
                        struct cmd_list_element *c)
 {
   xfree (target_description_filename);
index 5c612d1..2e02a77 100644 (file)
@@ -167,7 +167,7 @@ int may_stop = 1;
 static unsigned int targetdebug = 0;
 
 static void
-set_targetdebug  (char *args, int from_tty, struct cmd_list_element *c)
+set_targetdebug  (const char *args, int from_tty, struct cmd_list_element *c)
 {
   update_current_target ();
 }
@@ -345,7 +345,7 @@ complete_target_initialization (struct target_ops *t)
 /* This is used to implement the various target commands.  */
 
 static void
-open_target (char *args, int from_tty, struct cmd_list_element *command)
+open_target (const char *args, int from_tty, struct cmd_list_element *command)
 {
   struct target_ops *ops = (struct target_ops *) get_cmd_context (command);
 
@@ -3880,7 +3880,7 @@ int target_async_permitted = 1;
 static int target_async_permitted_1 = 1;
 
 static void
-maint_set_target_async_command (char *args, int from_tty,
+maint_set_target_async_command (const char *args, int from_tty,
                                struct cmd_list_element *c)
 {
   if (have_live_inferiors ())
@@ -3933,7 +3933,7 @@ static enum auto_boolean target_non_stop_enabled_1 = AUTO_BOOLEAN_AUTO;
 /* Implementation of "maint set target-non-stop".  */
 
 static void
-maint_set_target_non_stop_command (char *args, int from_tty,
+maint_set_target_non_stop_command (const char *args, int from_tty,
                                   struct cmd_list_element *c)
 {
   if (have_live_inferiors ())
@@ -3989,7 +3989,7 @@ update_target_permissions (void)
    way.  */
 
 static void
-set_target_permissions (char *args, int from_tty,
+set_target_permissions (const char *args, int from_tty,
                        struct cmd_list_element *c)
 {
   if (target_has_execution)
@@ -4010,7 +4010,7 @@ set_target_permissions (char *args, int from_tty,
 /* Set memory write permission independently of observer mode.  */
 
 static void
-set_write_memory_permission (char *args, int from_tty,
+set_write_memory_permission (const char *args, int from_tty,
                        struct cmd_list_element *c)
 {
   /* Make the real values match the user-changed values.  */
index 8ebdc07..63e61e7 100644 (file)
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -1763,7 +1763,8 @@ set_readline_history_size (int history_size)
 
 /* Called by do_setshow_command.  */
 static void
-set_history_size_command (char *args, int from_tty, struct cmd_list_element *c)
+set_history_size_command (const char *args,
+                         int from_tty, struct cmd_list_element *c)
 {
   set_readline_history_size (history_size_setshow_var);
 }
@@ -1786,7 +1787,7 @@ int info_verbose = 0;             /* Default verbose msgs off.  */
 
 /* Called by do_setshow_command.  An elaborate joke.  */
 void
-set_verbose (char *args, int from_tty, struct cmd_list_element *c)
+set_verbose (const char *args, int from_tty, struct cmd_list_element *c)
 {
   const char *cmdname = "verbose";
   struct cmd_list_element *showcmd;
@@ -1886,7 +1887,7 @@ show_prompt (struct ui_file *file, int from_tty,
 /* "set editing" command.  */
 
 static void
-set_editing (char *args, int from_tty, struct cmd_list_element *c)
+set_editing (const char *args, int from_tty, struct cmd_list_element *c)
 {
   change_line_handler (set_editing_cmd_var);
   /* Update the control variable so that MI's =cmd-param-changed event
@@ -1925,7 +1926,7 @@ static char *staged_gdb_datadir;
 /* "set" command for the gdb_datadir configuration variable.  */
 
 static void
-set_gdb_datadir (char *args, int from_tty, struct cmd_list_element *c)
+set_gdb_datadir (const char *args, int from_tty, struct cmd_list_element *c)
 {
   set_gdb_data_directory (staged_gdb_datadir);
   observer_notify_gdb_datadir_changed ();
@@ -1942,7 +1943,8 @@ show_gdb_datadir (struct ui_file *file, int from_tty,
 }
 
 static void
-set_history_filename (char *args, int from_tty, struct cmd_list_element *c)
+set_history_filename (const char *args,
+                     int from_tty, struct cmd_list_element *c)
 {
   /* We include the current directory so that if the user changes
      directories the file written will be the same as the one
index d265d6b..65d1f08 100644 (file)
--- a/gdb/top.h
+++ b/gdb/top.h
@@ -287,7 +287,7 @@ extern void set_history (const char *, int);
 
 extern void show_history (const char *, int);
 
-extern void set_verbose (char *, int, struct cmd_list_element *);
+extern void set_verbose (const char *, int, struct cmd_list_element *);
 
 extern char *handle_line_of_input (struct buffer *cmd_line_buffer,
                                   char *rl, int repeat,
index f7e35da..134695e 100644 (file)
@@ -2913,28 +2913,28 @@ encode_source_string (int tpnum, ULONGEST addr,
    disconnects for some reason.  */
 
 static void
-set_disconnected_tracing (char *args, int from_tty,
+set_disconnected_tracing (const char *args, int from_tty,
                          struct cmd_list_element *c)
 {
   target_set_disconnected_tracing (disconnected_tracing);
 }
 
 static void
-set_circular_trace_buffer (char *args, int from_tty,
+set_circular_trace_buffer (const char *args, int from_tty,
                           struct cmd_list_element *c)
 {
   target_set_circular_trace_buffer (circular_trace_buffer);
 }
 
 static void
-set_trace_buffer_size (char *args, int from_tty,
+set_trace_buffer_size (const char *args, int from_tty,
                           struct cmd_list_element *c)
 {
   target_set_trace_buffer_size (trace_buffer_size);
 }
 
 static void
-set_trace_user (char *args, int from_tty,
+set_trace_user (const char *args, int from_tty,
                struct cmd_list_element *c)
 {
   int ret;
@@ -2946,7 +2946,7 @@ set_trace_user (char *args, int from_tty,
 }
 
 static void
-set_trace_notes (char *args, int from_tty,
+set_trace_notes (const char *args, int from_tty,
                 struct cmd_list_element *c)
 {
   int ret;
@@ -2958,7 +2958,7 @@ set_trace_notes (char *args, int from_tty,
 }
 
 static void
-set_trace_stop_notes (char *args, int from_tty,
+set_trace_stop_notes (const char *args, int from_tty,
                      struct cmd_list_element *c)
 {
   int ret;
index 685cf06..cbeff1f 100644 (file)
@@ -348,7 +348,8 @@ tui_get_cmd_list (void)
 /* The set_func hook of "set tui ..." commands that affect the window
    borders on the TUI display.  */
 void
-tui_set_var_cmd (char *null_args, int from_tty, struct cmd_list_element *c)
+tui_set_var_cmd (const char *null_args,
+                int from_tty, struct cmd_list_element *c)
 {
   if (tui_update_variables () && tui_active)
     tui_rehighlight_all ();
index 15810e4..427af17 100644 (file)
@@ -672,7 +672,8 @@ show_print_type (const char *args, int from_tty)
 static int print_methods = 1;
 
 static void
-set_print_type_methods (char *args, int from_tty, struct cmd_list_element *c)
+set_print_type_methods (const char *args,
+                       int from_tty, struct cmd_list_element *c)
 {
   default_ptype_flags.print_methods = print_methods;
 }
@@ -688,7 +689,8 @@ show_print_type_methods (struct ui_file *file, int from_tty,
 static int print_typedefs = 1;
 
 static void
-set_print_type_typedefs (char *args, int from_tty, struct cmd_list_element *c)
+set_print_type_typedefs (const char *args,
+                        int from_tty, struct cmd_list_element *c)
 {
   default_ptype_flags.print_typedefs = print_typedefs;
 }
index dd74684..f3fc16c 100644 (file)
@@ -1459,14 +1459,14 @@ set_width (void)
 }
 
 static void
-set_width_command (char *args, int from_tty, struct cmd_list_element *c)
+set_width_command (const char *args, int from_tty, struct cmd_list_element *c)
 {
   set_screen_size ();
   set_width ();
 }
 
 static void
-set_height_command (char *args, int from_tty, struct cmd_list_element *c)
+set_height_command (const char *args, int from_tty, struct cmd_list_element *c)
 {
   set_screen_size ();
 }
index 0cdb23f..9b07221 100644 (file)
@@ -82,12 +82,8 @@ struct cmd_list_element *showprintrawlist;
 static int partial_memory_read (CORE_ADDR memaddr, gdb_byte *myaddr,
                                int len, int *errptr);
 
-static void set_input_radix (char *, int, struct cmd_list_element *);
-
 static void set_input_radix_1 (int, unsigned);
 
-static void set_output_radix (char *, int, struct cmd_list_element *);
-
 static void set_output_radix_1 (int, unsigned);
 
 static void val_print_type_code_flags (struct type *type,
@@ -2896,7 +2892,7 @@ static unsigned input_radix_1 = 10;
    setting the input radix to "10" never changes it!  */
 
 static void
-set_input_radix (char *args, int from_tty, struct cmd_list_element *c)
+set_input_radix (const char *args, int from_tty, struct cmd_list_element *c)
 {
   set_input_radix_1 (from_tty, input_radix_1);
 }
@@ -2933,7 +2929,7 @@ set_input_radix_1 (int from_tty, unsigned radix)
 static unsigned output_radix_1 = 10;
 
 static void
-set_output_radix (char *args, int from_tty, struct cmd_list_element *c)
+set_output_radix (const char *args, int from_tty, struct cmd_list_element *c)
 {
   set_output_radix_1 (from_tty, output_radix_1);
 }
index 5225e4e..1d1e619 100644 (file)
@@ -969,7 +969,7 @@ gdb_static_assert (sizeof (LONGEST) <= MIN_VALUE_FOR_MAX_VALUE_SIZE);
 /* Implement the "set max-value-size" command.  */
 
 static void
-set_max_value_size (char *args, int from_tty,
+set_max_value_size (const char *args, int from_tty,
                    struct cmd_list_element *c)
 {
   gdb_assert (max_value_size == -1 || max_value_size >= 0);