aboutsummaryrefslogtreecommitdiff
path: root/gdb/gnu-nat.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2017-10-13 22:58:21 -0600
committerTom Tromey <tom@tromey.com>2017-11-07 13:59:09 -0700
commit5fed81ff351121887a93b5b57caebb86667cbbd2 (patch)
tree571f96134b9dd45b2778469c750a59ccc62bb624 /gdb/gnu-nat.c
parent1d12d88f186fe1ae66deccf877b5509c506c4d39 (diff)
downloadgdb-5fed81ff351121887a93b5b57caebb86667cbbd2.zip
gdb-5fed81ff351121887a93b5b57caebb86667cbbd2.tar.gz
gdb-5fed81ff351121887a93b5b57caebb86667cbbd2.tar.bz2
Remove cmd_cfunc_ftype
This removes cmd_cfunc_ftype and the non-const overload of add_cmd; then fixes up the fallout. For the most part this patch is straightforward. There are a few files (go32-nat.c, windows-nat.c, and gnu-nat.c) that I could not compile; so I made a best effort there. gdb/ChangeLog 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) (set_thread_default_pause_cmd, set_thread_default_run_cmd) (show_thread_default_run_cmd, set_thread_default_detach_sc_cmd) (parse_int_arg, show_thread_default_detach_sc_cmd) (set_signals_cmd, show_signals_cmd, set_sig_thread_cmd) (show_sig_thread_cmd, set_stopped_cmd, show_stopped_cmd) (set_exceptions_cmd, show_exceptions_cmd, set_task_pause_cmd) (show_task_pause_cmd, set_task_detach_sc_cmd) (show_task_detach_sc_cmd, set_task_exc_port_cmd) (set_noninvasive_cmd, set_thread_pause_cmd) (show_thread_pause_cmd, set_thread_run_cmd, show_thread_run_cmd) (set_thread_detach_sc_cmd, show_thread_detach_sc_cmd) (set_thread_exc_port_cmd, thread_takeover_sc_cmd): Constify. * windows-nat.c (display_selectors): Constify. * cli/cli-decode.h (struct cmd_list_element) <function>: Remove non-const "cfunc". * cli/cli-decode.c (set_cmd_cfunc): Remove non-const overload. (cmd_cfunc_eq): Likewise. (struct cmd_list_element): Likewise. (do_cfunc): Remove. (cli_user_command_p): Update. * command.h (add_cmd): Remove non-const overload. (cmd_cfunc_ftype): Remove typedef. (cmd_cfunc_eq): Remove non-const overload. * value.c (show_values): Constify. * thread.c (thread_apply_all_command): Constify. * symfile.c (load_command): Constify. * source.c (directory_command): Constify. * maint.c (maintenance_internal_error) (maintenance_demangler_warning, maintenance_space_display) (maintenance_print_architecture, maintenance_translate_address) (maintenance_info_selftests, maintenance_internal_warning): Constify. * breakpoint.c (disable_trace_command, enable_trace_command): Constify. * auto-load.c (info_auto_load_local_gdbinit, add_auto_load_dir): Constify. (add_auto_load_safe_path): Constify. * guile/scm-auto-load.c (info_auto_load_guile_scripts): Constify. * top.h (show_commands): Constify. * linux-thread-db.c (info_auto_load_libthread_db): Constify. * sparc64-tdep.c (adi_examine_command): Constify. (adi_assign_command): Constify.
Diffstat (limited to 'gdb/gnu-nat.c')
-rw-r--r--gdb/gnu-nat.c60
1 files changed, 30 insertions, 30 deletions
diff --git a/gdb/gnu-nat.c b/gdb/gnu-nat.c
index 609ba50..0d500ea 100644
--- a/gdb/gnu-nat.c
+++ b/gdb/gnu-nat.c
@@ -2742,7 +2742,7 @@ show_thread_default_cmd (const char *args, int from_tty)
}
static int
-parse_int_arg (char *args, char *cmd_prefix)
+parse_int_arg (const char *args, char *cmd_prefix)
{
if (args)
{
@@ -2757,7 +2757,7 @@ parse_int_arg (char *args, char *cmd_prefix)
}
static int
-_parse_bool_arg (char *args, char *t_val, char *f_val, char *cmd_prefix)
+_parse_bool_arg (const char *args, char *t_val, char *f_val, char *cmd_prefix)
{
if (!args || strcmp (args, t_val) == 0)
return 1;
@@ -2818,13 +2818,13 @@ set_task_pause_cmd (int arg, int from_tty)
}
static void
-set_task_pause_cmd (char *args, int from_tty)
+set_task_pause_cmd (const char *args, int from_tty)
{
set_task_pause_cmd (parse_bool_arg (args, "set task pause"), from_tty);
}
static void
-show_task_pause_cmd (char *args, int from_tty)
+show_task_pause_cmd (const char *args, int from_tty)
{
struct inf *inf = cur_inf ();
@@ -2836,14 +2836,14 @@ show_task_pause_cmd (char *args, int from_tty)
}
static void
-set_task_detach_sc_cmd (char *args, int from_tty)
+set_task_detach_sc_cmd (const char *args, int from_tty)
{
cur_inf ()->detach_sc = parse_int_arg (args,
"set task detach-suspend-count");
}
static void
-show_task_detach_sc_cmd (char *args, int from_tty)
+show_task_detach_sc_cmd (const char *args, int from_tty)
{
check_empty (args, "show task detach-suspend-count");
printf_unfiltered ("The inferior task will be left with a "
@@ -2853,7 +2853,7 @@ show_task_detach_sc_cmd (char *args, int from_tty)
static void
-set_thread_default_pause_cmd (char *args, int from_tty)
+set_thread_default_pause_cmd (const char *args, int from_tty)
{
struct inf *inf = cur_inf ();
@@ -2862,7 +2862,7 @@ set_thread_default_pause_cmd (char *args, int from_tty)
}
static void
-show_thread_default_pause_cmd (char *args, int from_tty)
+show_thread_default_pause_cmd (const char *args, int from_tty)
{
struct inf *inf = cur_inf ();
int sc = inf->default_thread_pause_sc;
@@ -2874,7 +2874,7 @@ show_thread_default_pause_cmd (char *args, int from_tty)
}
static void
-set_thread_default_run_cmd (char *args, int from_tty)
+set_thread_default_run_cmd (const char *args, int from_tty)
{
struct inf *inf = cur_inf ();
@@ -2883,7 +2883,7 @@ set_thread_default_run_cmd (char *args, int from_tty)
}
static void
-show_thread_default_run_cmd (char *args, int from_tty)
+show_thread_default_run_cmd (const char *args, int from_tty)
{
struct inf *inf = cur_inf ();
@@ -2893,14 +2893,14 @@ show_thread_default_run_cmd (char *args, int from_tty)
}
static void
-set_thread_default_detach_sc_cmd (char *args, int from_tty)
+set_thread_default_detach_sc_cmd (const char *args, int from_tty)
{
cur_inf ()->default_thread_detach_sc =
parse_int_arg (args, "set thread default detach-suspend-count");
}
static void
-show_thread_default_detach_sc_cmd (char *args, int from_tty)
+show_thread_default_detach_sc_cmd (const char *args, int from_tty)
{
check_empty (args, "show thread default detach-suspend-count");
printf_unfiltered ("New threads will get a detach-suspend-count of %d.\n",
@@ -2946,7 +2946,7 @@ steal_exc_port (struct proc *proc, mach_port_t name)
}
static void
-set_task_exc_port_cmd (char *args, int from_tty)
+set_task_exc_port_cmd (const char *args, int from_tty)
{
struct inf *inf = cur_inf ();
@@ -2956,13 +2956,13 @@ set_task_exc_port_cmd (char *args, int from_tty)
}
static void
-set_stopped_cmd (char *args, int from_tty)
+set_stopped_cmd (const char *args, int from_tty)
{
cur_inf ()->stopped = _parse_bool_arg (args, "yes", "no", "set stopped");
}
static void
-show_stopped_cmd (char *args, int from_tty)
+show_stopped_cmd (const char *args, int from_tty)
{
struct inf *inf = active_inf ();
@@ -2972,7 +2972,7 @@ show_stopped_cmd (char *args, int from_tty)
}
static void
-set_sig_thread_cmd (char *args, int from_tty)
+set_sig_thread_cmd (const char *args, int from_tty)
{
struct inf *inf = cur_inf ();
@@ -2990,7 +2990,7 @@ set_sig_thread_cmd (char *args, int from_tty)
}
static void
-show_sig_thread_cmd (char *args, int from_tty)
+show_sig_thread_cmd (const char *args, int from_tty)
{
struct inf *inf = active_inf ();
@@ -3016,13 +3016,13 @@ set_signals_cmd (int arg, int from_tty)
}
static void
-set_signals_cmd (char *args, int from_tty)
+set_signals_cmd (const char *args, int from_tty)
{
set_signals_cmd(parse_bool_arg (args, "set signals"), from_tty);
}
static void
-show_signals_cmd (char *args, int from_tty)
+show_signals_cmd (const char *args, int from_tty)
{
struct inf *inf = cur_inf ();
@@ -3045,13 +3045,13 @@ set_exceptions_cmd (int arg, int from_tty)
}
static void
-set_exceptions_cmd (char *args, int from_tty)
+set_exceptions_cmd (const char *args, int from_tty)
{
set_exceptions_cmd (parse_bool_arg (args, "set exceptions"), from_tty);
}
static void
-show_exceptions_cmd (char *args, int from_tty)
+show_exceptions_cmd (const char *args, int from_tty)
{
struct inf *inf = cur_inf ();
@@ -3099,7 +3099,7 @@ show_task_cmd (const char *args, int from_tty)
static void
-set_noninvasive_cmd (char *args, int from_tty)
+set_noninvasive_cmd (const char *args, int from_tty)
{
/* Invert the sense of the arg for each component. */
int inv_arg = parse_bool_arg (args, "set noninvasive") ? 0 : 1;
@@ -3301,7 +3301,7 @@ This is the same as setting `task pause', `exceptions', and\n\
static void
-set_thread_pause_cmd (char *args, int from_tty)
+set_thread_pause_cmd (const char *args, int from_tty)
{
struct proc *thread = cur_thread ();
int old_sc = thread->pause_sc;
@@ -3314,7 +3314,7 @@ set_thread_pause_cmd (char *args, int from_tty)
}
static void
-show_thread_pause_cmd (char *args, int from_tty)
+show_thread_pause_cmd (const char *args, int from_tty)
{
struct proc *thread = cur_thread ();
int sc = thread->pause_sc;
@@ -3327,7 +3327,7 @@ show_thread_pause_cmd (char *args, int from_tty)
}
static void
-set_thread_run_cmd (char *args, int from_tty)
+set_thread_run_cmd (const char *args, int from_tty)
{
struct proc *thread = cur_thread ();
@@ -3335,7 +3335,7 @@ set_thread_run_cmd (char *args, int from_tty)
}
static void
-show_thread_run_cmd (char *args, int from_tty)
+show_thread_run_cmd (const char *args, int from_tty)
{
struct proc *thread = cur_thread ();
@@ -3346,14 +3346,14 @@ show_thread_run_cmd (char *args, int from_tty)
}
static void
-set_thread_detach_sc_cmd (char *args, int from_tty)
+set_thread_detach_sc_cmd (const char *args, int from_tty)
{
cur_thread ()->detach_sc = parse_int_arg (args,
"set thread detach-suspend-count");
}
static void
-show_thread_detach_sc_cmd (char *args, int from_tty)
+show_thread_detach_sc_cmd (const char *args, int from_tty)
{
struct proc *thread = cur_thread ();
@@ -3365,7 +3365,7 @@ show_thread_detach_sc_cmd (char *args, int from_tty)
}
static void
-set_thread_exc_port_cmd (char *args, int from_tty)
+set_thread_exc_port_cmd (const char *args, int from_tty)
{
struct proc *thread = cur_thread ();
@@ -3389,7 +3389,7 @@ show_thread_cmd (char *args, int from_tty)
#endif
static void
-thread_takeover_sc_cmd (char *args, int from_tty)
+thread_takeover_sc_cmd (const char *args, int from_tty)
{
struct proc *thread = cur_thread ();