]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit - gdb/maint.c
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)
commit981a3fb3594dddae266b7a5014c3001727200d7b
tree15c1edb975e878b6b8ae49466b3bd539b7f87681
parentfdf44873ec6e37417bf8c8ce33bb9b1a6b4ddcef
Constify add_prefix_cmd

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