Commit Graph

49 Commits

Author SHA1 Message Date
Tom Tromey 981a3fb359 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.
2017-10-11 16:21:02 -06:00
Anton Kolesov 56d704daee arc: Pass proper CPU value to the disassembler
There was a problem with generation of the disassembler options for ARC in GDB,
because a BFD architecture name was used as a CPU name, but they have different
meaning even if some architectures have same name as respective CPUs.  Target
description specifies a BFD architecture, which is different from ARC CPU, as
accepted by the disassembler (and most other ARC tools), because CPU values are
much more fine grained - there can be multiple CPU values per single BFD
architecture.  As a result this code should translate architecture to some CPU
value.  Since there is no info on exact CPU configuration, it is best to use
the most feature-rich CPU, so that the disassembler will recognize all
instructions available to the specified architecture.

gdb/ChangeLog
yyyy-mm-dd  Anton Kolesov  <Anton.Kolesov@synopsys.com>

	* arc-tdep.c (arc_gdbarch_init): Pass proper cpu value to disassembler.
	* arc-tdep.h (arc_arch_is_em): New function.
	(arc_arch_is_hs): Likewise.

gdb/testsuite/ChangeLog
yyyy-mm-dd  Anton Kolesov  <Anton.Kolesov@synopsys.com>

	* gdb.arch/arc-tdesc-cpu.exp: New file.
	* gdb.arch/arc-tdesc-cpu.xml: Likewise.
2017-10-11 15:42:52 +03:00
Tom Tromey 57f5a81bd2 Constify dump_arc_instruction_command
gdb/ChangeLog
2017-09-27  Tom Tromey  <tom@tromey.com>

	* arc-tdep.c (dump_arc_instruction_command): Constify.
2017-09-27 08:44:18 -06:00
John Baldwin 481695ed5f Remove unnecessary function prototypes.
These prototypes were required when compiling GDB as C but are not
required for C++.

gdb/ChangeLog:

	* aarch64-linux-nat.c: Remove _initialize_aarch64_linux_nat
	prototype.
	* aarch64-linux-tdep.c: Remove _initialize_aarch64_linux_tdep
	prototype.
	* aarch64-newlib-tdep.c: Remove _initialize_aarch64_newlib_tdep
	prototype.
	* aarch64-tdep.c: Remove _initialize_aarch64_tdep prototype.
	* ada-exp.y: Remove _initialize_ada_exp prototype.
	* ada-lang.c: Remove _initialize_ada_language prototype.
	* ada-tasks.c: Remove _initialize_tasks prototype.
	* addrmap.c: Remove _initialize_addrmap prototype.
	* agent.c: Remove _initialize_agent prototype.
	* aix-thread.c: Remove _initialize_aix_thread prototype.
	* alpha-bsd-nat.c: Remove _initialize_alphabsd_nat prototype.
	* alpha-linux-nat.c: Remove _initialize_alpha_linux_nat prototype.
	* alpha-linux-tdep.c: Remove _initialize_alpha_linux_tdep
	prototype.
	* alpha-nbsd-tdep.c: Remove _initialize_alphanbsd_tdep prototype.
	* alpha-obsd-tdep.c: Remove _initialize_alphaobsd_tdep prototype.
	* alpha-tdep.c: Remove _initialize_alpha_tdep prototype.
	* amd64-darwin-tdep.c: Remove _initialize_amd64_darwin_tdep
	prototype.
	* amd64-dicos-tdep.c: Remove _initialize_amd64_dicos_tdep
	prototype.
	* amd64-fbsd-nat.c: Remove _initialize_amd64fbsd_nat prototype.
	* amd64-fbsd-tdep.c: Remove _initialize_amd64fbsd_tdep prototype.
	* amd64-linux-nat.c: Remove _initialize_amd64_linux_nat prototype.
	* amd64-linux-tdep.c: Remove _initialize_amd64_linux_tdep
	prototype.
	* amd64-nbsd-nat.c: Remove _initialize_amd64nbsd_nat prototype.
	* amd64-nbsd-tdep.c: Remove _initialize_amd64nbsd_tdep prototype.
	* amd64-obsd-nat.c: Remove _initialize_amd64obsd_nat prototype.
	* amd64-obsd-tdep.c: Remove _initialize_amd64obsd_tdep prototype.
	* amd64-sol2-tdep.c: Remove _initialize_amd64_sol2_tdep prototype.
	* amd64-tdep.c: Remove _initialize_amd64_tdep prototype.
	* amd64-windows-nat.c: Remove _initialize_amd64_windows_nat
	prototype.
	* amd64-windows-tdep.c: Remove _initialize_amd64_windows_tdep
	prototype.
	* annotate.c: Remove _initialize_annotate prototype.
	* arc-newlib-tdep.c: Remove _initialize_arc_newlib_tdep prototype.
	* arc-tdep.c: Remove _initialize_arc_tdep prototype.
	* arch-utils.c: Remove _initialize_gdbarch_utils prototype.
	* arm-linux-nat.c: Remove _initialize_arm_linux_nat prototype.
	* arm-linux-tdep.c: Remove _initialize_arm_linux_tdep prototype.
	* arm-nbsd-tdep.c: Remove _initialize_arm_netbsd_tdep prototype.
	* arm-obsd-tdep.c: Remove _initialize_armobsd_tdep prototype.
	* arm-symbian-tdep.c: Remove _initialize_arm_symbian_tdep
	prototype.
	* arm-tdep.c: Remove _initialize_arm_tdep prototype.
	* arm-wince-tdep.c: Remove _initialize_arm_wince_tdep prototype.
	* auto-load.c: Remove _initialize_auto_load prototype.
	* auxv.c: Remove _initialize_auxv prototype.
	* avr-tdep.c: Remove _initialize_avr_tdep prototype.
	* ax-gdb.c: Remove _initialize_ax_gdb prototype.
	* bfin-linux-tdep.c: Remove _initialize_bfin_linux_tdep prototype.
	* bfin-tdep.c: Remove _initialize_bfin_tdep prototype.
	* break-catch-sig.c: Remove _initialize_break_catch_sig prototype.
	* break-catch-syscall.c: Remove _initialize_break_catch_syscall
	prototype.
	* break-catch-throw.c: Remove _initialize_break_catch_throw
	prototype.
	* breakpoint.c: Remove _initialize_breakpoint prototype.
	* bsd-uthread.c: Remove _initialize_bsd_uthread prototype.
	* btrace.c: Remove _initialize_btrace prototype.
	* charset.c: Remove _initialize_charset prototype.
	* cli/cli-cmds.c: Remove _initialize_cli_cmds prototype.
	* cli/cli-dump.c: Remove _initialize_cli_dump prototype.
	* cli/cli-interp.c: Remove _initialize_cli_interp prototype.
	* cli/cli-logging.c: Remove _initialize_cli_logging prototype.
	* cli/cli-script.c: Remove _initialize_cli_script prototype.
	* coff-pe-read.c: Remove _initialize_coff_pe_read prototype.
	* coffread.c: Remove _initialize_coffread prototype.
	* compile/compile.c: Remove _initialize_compile prototype.
	* complaints.c: Remove _initialize_complaints prototype.
	* completer.c: Remove _initialize_completer prototype.
	* copying.awk: Remove _initialize_copying prototype.
	* copying.c: Regenerate.
	* core-regset.c: Remove _initialize_core_regset prototype.
	* corefile.c: Remove _initialize_core prototype.
	* corelow.c: Remove _initialize_corelow prototype.
	* cp-abi.c: Remove _initialize_cp_abi prototype.
	* cp-namespace.c: Remove _initialize_cp_namespace prototype.
	* cp-support.c: Remove _initialize_cp_support prototype.
	* cp-valprint.c: Remove _initialize_cp_valprint prototype.
	* cris-linux-tdep.c: Remove _initialize_cris_linux_tdep prototype.
	* cris-tdep.c: Remove _initialize_cris_tdep prototype.
	* ctf.c: Remove _initialize_ctf prototype.
	* d-lang.c: Remove _initialize_d_language prototype.
	* darwin-nat-info.c: Remove _initialize_darwin_info_commands
	prototype.
	* darwin-nat.c: Remove _initialize_darwin_inferior prototype.
	* dbxread.c: Remove _initialize_dbxread prototype.
	* dcache.c: Remove _initialize_dcache prototype.
	* demangle.c: Remove _initialize_demangler prototype.
	* disasm-selftests.c: Remove _initialize_disasm_selftests
	prototype.
	* disasm.c: Remove _initialize_disasm prototype.
	* dtrace-probe.c: Remove _initialize_dtrace_probe prototype.
	* dummy-frame.c: Remove _initialize_dummy_frame prototype.
	* dwarf2-frame-tailcall.c: Remove _initialize_tailcall_frame
	prototype.
	* dwarf2-frame.c: Remove _initialize_dwarf2_frame prototype.
	* dwarf2expr.c: Remove _initialize_dwarf2expr prototype.
	* dwarf2loc.c: Remove _initialize_dwarf2loc prototype.
	* dwarf2read.c: Remove _initialize_dwarf2_read prototype.
	* elfread.c: Remove _initialize_elfread prototype.
	* exec.c: Remove _initialize_exec prototype.
	* extension.c: Remove _initialize_extension prototype.
	* f-lang.c: Remove _initialize_f_language prototype.
	* f-valprint.c: Remove _initialize_f_valprint prototype.
	* fbsd-nat.c: Remove _initialize_fbsd_nat prototype.
	* fbsd-tdep.c: Remove _initialize_fbsd_tdep prototype.
	* filesystem.c: Remove _initialize_filesystem prototype.
	* findcmd.c: Remove _initialize_mem_search prototype.
	* fork-child.c: Remove _initialize_fork_child prototype.
	* frame-base.c: Remove _initialize_frame_base prototype.
	* frame-unwind.c: Remove _initialize_frame_unwind prototype.
	* frame.c: Remove _initialize_frame prototype.
	* frv-linux-tdep.c: Remove _initialize_frv_linux_tdep prototype.
	* frv-tdep.c: Remove _initialize_frv_tdep prototype.
	* ft32-tdep.c: Remove _initialize_ft32_tdep prototype.
	* gcore.c: Remove _initialize_gcore prototype.
	* gdb_bfd.c: Remove _initialize_gdb_bfd prototype.
	* gdbarch.c: Regenerate.
	* gdbarch.sh: Remove _initialize_gdbarch prototype.
	* gdbtypes.c: Remove _initialize_gdbtypes prototype.
	* gnu-nat.c: Remove _initialize_gnu_nat prototype.
	* gnu-v2-abi.c: Remove _initialize_gnu_v2_abi prototype.
	* gnu-v3-abi.c: Remove _initialize_gnu_v3_abi prototype.
	* go-lang.c: Remove _initialize_go_language prototype.
	* go32-nat.c: Remove _initialize_go32_nat prototype.
	* guile/guile.c: Remove _initialize_guile prototype.
	* h8300-tdep.c: Remove _initialize_h8300_tdep prototype.
	* hppa-linux-nat.c: Remove _initialize_hppa_linux_nat prototype.
	* hppa-linux-tdep.c: Remove _initialize_hppa_linux_tdep prototype.
	* hppa-nbsd-nat.c: Remove _initialize_hppanbsd_nat prototype.
	* hppa-nbsd-tdep.c: Remove _initialize_hppanbsd_tdep prototype.
	* hppa-obsd-nat.c: Remove _initialize_hppaobsd_nat prototype.
	* hppa-obsd-tdep.c: Remove _initialize_hppaobsd_tdep prototype.
	* hppa-tdep.c: Remove _initialize_hppa_tdep prototype.
	* i386-bsd-nat.c: Remove _initialize_i386bsd_nat prototype.
	* i386-cygwin-tdep.c: Remove _initialize_i386_cygwin_tdep
	prototype.
	* i386-darwin-tdep.c: Remove _initialize_i386_darwin_tdep
	prototype.
	* i386-dicos-tdep.c: Remove _initialize_i386_dicos_tdep prototype.
	* i386-fbsd-nat.c: Remove _initialize_i386fbsd_nat prototype.
	* i386-fbsd-tdep.c: Remove _initialize_i386fbsd_tdep prototype.
	* i386-gnu-nat.c: Remove _initialize_i386gnu_nat prototype.
	* i386-gnu-tdep.c: Remove _initialize_i386gnu_tdep prototype.
	* i386-linux-nat.c: Remove _initialize_i386_linux_nat prototype.
	* i386-linux-tdep.c: Remove _initialize_i386_linux_tdep prototype.
	* i386-nbsd-nat.c: Remove _initialize_i386nbsd_nat prototype.
	* i386-nbsd-tdep.c: Remove _initialize_i386nbsd_tdep prototype.
	* i386-nto-tdep.c: Remove _initialize_i386nto_tdep prototype.
	* i386-obsd-nat.c: Remove _initialize_i386obsd_nat prototype.
	* i386-obsd-tdep.c: Remove _initialize_i386obsd_tdep prototype.
	* i386-sol2-nat.c: Remove _initialize_amd64_sol2_nat prototype.
	* i386-sol2-tdep.c: Remove _initialize_amd64_sol2_tdep prototype.
	* i386-tdep.c: Remove _initialize_i386_tdep prototype.
	* i386-windows-nat.c: Remove _initialize_i386_windows_nat
	prototype.
	* ia64-libunwind-tdep.c: Remove _initialize_libunwind_frame
	prototype.
	* ia64-linux-nat.c: Remove _initialize_ia64_linux_nat prototype.
	* ia64-linux-tdep.c: Remove _initialize_ia64_linux_tdep prototype.
	* ia64-tdep.c: Remove _initialize_ia64_tdep prototype.
	* ia64-vms-tdep.c: Remove _initialize_ia64_vms_tdep prototype.
	* infcall.c: Remove _initialize_infcall prototype.
	* infcmd.c: Remove _initialize_infcmd prototype.
	* inferior.c: Remove _initialize_inferiors prototype.
	* inflow.c: Remove _initialize_inflow prototype.
	* infrun.c: Remove _initialize_infrun prototype.
	* interps.c: Remove _initialize_interpreter prototype.
	* iq2000-tdep.c: Remove _initialize_iq2000_tdep prototype.
	* jit.c: Remove _initialize_jit prototype.
	* language.c: Remove _initialize_language prototype.
	* linux-fork.c: Remove _initialize_linux_fork prototype.
	* linux-nat.c: Remove _initialize_linux_nat prototype.
	* linux-tdep.c: Remove _initialize_linux_tdep prototype.
	* linux-thread-db.c: Remove _initialize_thread_db prototype.
	* lm32-tdep.c: Remove _initialize_lm32_tdep prototype.
	* m2-lang.c: Remove _initialize_m2_language prototype.
	* m32c-tdep.c: Remove _initialize_m32c_tdep prototype.
	* m32r-linux-nat.c: Remove _initialize_m32r_linux_nat prototype.
	* m32r-linux-tdep.c: Remove _initialize_m32r_linux_tdep prototype.
	* m32r-tdep.c: Remove _initialize_m32r_tdep prototype.
	* m68hc11-tdep.c: Remove _initialize_m68hc11_tdep prototype.
	* m68k-bsd-nat.c: Remove _initialize_m68kbsd_nat prototype.
	* m68k-bsd-tdep.c: Remove _initialize_m68kbsd_tdep prototype.
	* m68k-linux-nat.c: Remove _initialize_m68k_linux_tdep prototype.
	* m68k-linux-tdep.c: Remove _initialize_m68k_linux_tdep prototype.
	* m68k-tdep.c: Remove _initialize_m68k_tdep prototype.
	* m88k-bsd-nat.c: Remove _initialize_m68kbsd_nat prototype.
	* m88k-tdep.c: Remove _initialize_m68kbsd_tdep prototype.
	* machoread.c: Remove _initialize_machoread prototype.
	* macrocmd.c: Remove _initialize_macrocmd prototype.
	* macroscope.c: Remove _initialize_macroscope prototype.
	* maint.c: Remove _initialize_maint_cmds prototype.
	* mdebugread.c: Remove _initialize_mdebugread prototype.
	* memattr.c: Remove _initialize_mem prototype.
	* mep-tdep.c: Remove _initialize_mep_tdep prototype.
	* mi/mi-cmd-env.c: Remove _initialize_mi_cmd_env prototype.
	* mi/mi-cmds.c: Remove _initialize_mi_cmds prototype.
	* mi/mi-interp.c: Remove _initialize_mi_interp prototype.
	* mi/mi-main.c: Remove _initialize_mi_main prototype.
	* microblaze-linux-tdep.c: Remove
	_initialize_microblaze_linux_tdep prototype.
	* microblaze-tdep.c: Remove _initialize_microblaze_tdep prototype.
	* mips-fbsd-nat.c: Remove _initialize_mips_fbsd_nat prototype.
	* mips-fbsd-tdep.c: Remove _initialize_mips_fbsd_tdep prototype.
	* mips-linux-nat.c: Remove _initialize_mips_linux_nat prototype.
	* mips-linux-tdep.c: Remove _initialize_mips_linux_tdep prototype.
	* mips-nbsd-nat.c: Remove _initialize_mipsnbsd_nat prototype.
	* mips-nbsd-tdep.c: Remove _initialize_mipsnbsd_tdep prototype.
	* mips-sde-tdep.c: Remove _initialize_mips_sde_tdep prototype.
	* mips-tdep.c: Remove _initialize_mips_tdep prototype.
	* mips64-obsd-nat.c: Remove _initialize_mips64obsd_nat prototype.
	* mips64-obsd-tdep.c: Remove _initialize_mips64obsd_tdep
	prototype.
	* mipsread.c: Remove _initialize_mipsread prototype.
	* mn10300-linux-tdep.c: Remove _initialize_mn10300_linux_tdep
	prototype.
	* mn10300-tdep.c: Remove _initialize_mn10300_tdep prototype.
	* moxie-tdep.c: Remove _initialize_moxie_tdep prototype.
	* msp430-tdep.c: Remove _initialize_msp430_tdep prototype.
	* mt-tdep.c: Remove _initialize_mt_tdep prototype.
	* nds32-tdep.c: Remove _initialize_nds32_tdep prototype.
	* nios2-linux-tdep.c: Remove _initialize_nios2_linux_tdep
	prototype.
	* nios2-tdep.c: Remove _initialize_nios2_tdep prototype.
	* nto-procfs.c: Remove _initialize_procfs prototype.
	* nto-tdep.c: Remove _initialize_nto_tdep prototype.
	* objc-lang.c: Remove _initialize_objc_language prototype.
	* objfiles.c: Remove _initialize_objfiles prototype.
	* observer.c: Remove observer_test_first_notification_function,
	observer_test_second_notification_function,
	observer_test_third_notification_function, and
	_initialize_observer prototypes.
	* opencl-lang.c: Remove _initialize_opencl_language prototypes.
	* osabi.c: Remove _initialize_gdb_osabi prototype.
	* osdata.c: Remove _initialize_osdata prototype.
	* p-valprint.c: Remove _initialize_pascal_valprint prototype.
	* parse.c: Remove _initialize_parse prototype.
	* ppc-fbsd-nat.c: Remove _initialize_ppcfbsd_nat prototype.
	* ppc-fbsd-tdep.c: Remove _initialize_ppcfbsd_tdep prototype.
	* ppc-linux-nat.c: Remove _initialize_ppc_linux_nat prototype.
	* ppc-linux-tdep.c: Remove _initialize_ppc_linux_tdep prototype.
	* ppc-nbsd-nat.c: Remove _initialize_ppcnbsd_nat prototype.
	* ppc-nbsd-tdep.c: Remove _initialize_ppcnbsd_tdep prototype.
	* ppc-obsd-nat.c: Remove _initialize_ppcobsd_nat prototype.
	* ppc-obsd-tdep.c: Remove _initialize_ppcobsd_tdep prototype.
	* printcmd.c: Remove _initialize_printcmd prototype.
	* probe.c: Remove _initialize_probe prototype.
	* proc-api.c: Remove _initialize_proc_api prototype.
	* proc-events.c: Remove _initialize_proc_events prototype.
	* proc-service.c: Remove _initialize_proc_service prototype.
	* procfs.c: Remove _initialize_procfs prototype.
	* psymtab.c: Remove _initialize_psymtab prototype.
	* python/python.c: Remove _initialize_python prototype.
	* ravenscar-thread.c: Remove _initialize_ravenscar prototype.
	* record-btrace.c: Remove _initialize_record_btrace prototype.
	* record-full.c: Remove _initialize_record_full prototype.
	* record.c: Remove _initialize_record prototype.
	* regcache.c: Remove _initialize_regcache prototype.
	* reggroups.c: Remove _initialize_reggroup prototype.
	* remote-notif.c: Remove _initialize_notif prototype.
	* remote-sim.c: Remove _initialize_remote_sim prototype.
	* remote.c: Remove _initialize_remote prototype.
	* reverse.c: Remove _initialize_reverse prototype.
	* rl78-tdep.c: Remove _initialize_rl78_tdep prototype.
	* rs6000-aix-tdep.c: Remove _initialize_rs6000_aix_tdep prototype.
	* rs6000-lynx178-tdep.c: Remove _initialize_rs6000_lynx178_tdep
	prototype.
	* rs6000-nat.c: Remove _initialize_rs6000_nat prototype.
	* rs6000-tdep.c: Remove _initialize_rs6000_tdep prototype.
	* rust-exp.y: Remove _initialize_rust_exp prototype.
	* rx-tdep.c: Remove _initialize_rx_tdep prototype.
	* s390-linux-nat.c: Remove _initialize_s390_nat prototype.
	* s390-linux-tdep.c: Remove _initialize_s390_tdep prototype.
	* score-tdep.c: Remove _initialize_score_tdep prototype.
	* selftest-arch.c: Remove _initialize_selftests_foreach_arch
	prototype.
	* ser-go32.c: Remove _initialize_ser_dos prototype.
	* ser-mingw.c: Remove _initialize_ser_windows prototype.
	* ser-pipe.c: Remove _initialize_ser_pipe prototype.
	* ser-tcp.c: Remove _initialize_ser_tcp prototype.
	* ser-unix.c: Remove _initialize_ser_hardwire prototype.
	* serial.c: Remove _initialize_serial prototype.
	* sh-linux-tdep.c: Remove _initialize_sh_linux_tdep prototype.
	* sh-nbsd-nat.c: Remove _initialize_shnbsd_nat prototype.
	* sh-nbsd-tdep.c: Remove _initialize_shnbsd_tdep prototype.
	* sh-tdep.c: Remove _initialize_sh_tdep prototype.
	* skip.c: Remove _initialize_step_skip prototype.
	* sol-thread.c: Remove _initialize_sol_thread prototype.
	* solib-aix.c: Remove _initialize_solib_aix prototype.
	* solib-darwin.c: Remove _initialize_darwin_solib prototype.
	* solib-dsbt.c: Remove _initialize_dsbt_solib prototype.
	* solib-frv.c: Remove _initialize_frv_solib prototype.
	* solib-spu.c: Remove _initialize_spu_solib prototype.
	* solib-svr4.c: Remove _initialize_svr4_solib prototype.
	* solib-target.c: Remove _initialize_solib_target prototype.
	* solib.c: Remove _initialize_solib prototype.
	* source.c: Remove _initialize_source prototype.
	* sparc-linux-nat.c: Remove _initialize_sparc_linux_nat prototype.
	* sparc-linux-tdep.c: Remove _initialize_sparc_linux_tdep
	prototype.
	* sparc-nat.c: Remove _initialize_sparc_nat prototype.
	* sparc-nbsd-nat.c: Remove _initialize_sparcnbsd_nat prototype.
	* sparc-nbsd-tdep.c: Remove _initialize_sparcnbsd_tdep prototype.
	* sparc-obsd-tdep.c: Remove _initialize_sparc32obsd_tdep
	prototype.
	* sparc-sol2-nat.c: Remove _initialize_sparc_sol2_nat prototype.
	* sparc-sol2-tdep.c: Remove _initialize_sparc_sol2_tdep prototype.
	* sparc-tdep.c: Remove _initialize_sparc_tdep prototype.
	* sparc64-fbsd-nat.c: Remove _initialize_sparc64fbsd_nat
	prototype.
	* sparc64-fbsd-tdep.c: Remove _initialize_sparc64fbsd_tdep
	prototype.
	* sparc64-linux-nat.c: Remove _initialize_sparc64_linux_nat
	prototype.
	* sparc64-linux-tdep.c: Remove _initialize_sparc64_linux_tdep
	prototype.
	* sparc64-nat.c: Remove _initialize_sparc64_nat prototype.
	* sparc64-nbsd-nat.c: Remove _initialize_sparc64nbsd_nat
	prototype.
	* sparc64-nbsd-tdep.c: Remove _initialize_sparc64nbsd_tdep
	prototype.
	* sparc64-obsd-nat.c: Remove _initialize_sparc64obsd_nat
	prototype.
	* sparc64-obsd-tdep.c: Remove _initialize_sparc64obsd_tdep
	prototype.
	* sparc64-sol2-tdep.c: Remove _initialize_sparc64_sol2_tdep
	prototype.
	* spu-linux-nat.c: Remove _initialize_spu_nat prototype.
	* spu-multiarch.c: Remove _initialize_spu_multiarch prototype.
	* spu-tdep.c: Remove _initialize_spu_tdep prototype.
	* stabsread.c: Remove _initialize_stabsread prototype.
	* stack.c: Remove _initialize_stack prototype.
	* stap-probe.c: Remove _initialize_stap_probe prototype.
	* std-regs.c: Remove _initialize_frame_reg prototype.
	* symfile-debug.c: Remove _initialize_symfile_debug prototype.
	* symfile-mem.c: Remove _initialize_symfile_mem prototype.
	* symfile.c: Remove _initialize_symfile prototype.
	* symmisc.c: Remove _initialize_symmisc prototype.
	* symtab.c: Remove _initialize_symtab prototype.
	* target-dcache.c: Remove _initialize_target_dcache prototype.
	* target-descriptions.c: Remove _initialize_target_descriptions
	prototype.
	* thread.c: Remove _initialize_thread prototype.
	* tic6x-linux-tdep.c: Remove _initialize_tic6x_linux_tdep
	prototype.
	* tic6x-tdep.c: Remove _initialize_tic6x_tdep prototype.
	* tilegx-linux-nat.c: Remove _initialize_tile_linux_nat prototype.
	* tilegx-linux-tdep.c: Remove _initialize_tilegx_linux_tdep
	prototype.
	* tilegx-tdep.c: Remove _initialize_tilegx_tdep prototype.
	* tracefile-tfile.c: Remove _initialize_tracefile_tfile prototype.
	* tracefile.c: Remove _initialize_tracefile prototype.
	* tracepoint.c: Remove _initialize_tracepoint prototype.
	* tui/tui-hooks.c: Remove _initialize_tui_hooks prototype.
	* tui/tui-interp.c: Remove _initialize_tui_interp prototype.
	* tui/tui-layout.c: Remove _initialize_tui_layout prototype.
	* tui/tui-regs.c: Remove _initialize_tui_regs prototype.
	* tui/tui-stack.c: Remove _initialize_tui_stack prototype.
	* tui/tui-win.c: Remove _initialize_tui_win prototype.
	* tui/tui.c: Remove _initialize_tui prototype.
	* typeprint.c: Remove _initialize_typeprint prototype.
	* user-regs.c: Remove _initialize_user_regs prototype.
	* utils.c: Remove _initialize_utils prototype.
	* v850-tdep.c: Remove _initialize_v850_tdep prototype.
	* valarith.c: Remove _initialize_valarith prototype.
	* valops.c: Remove _initialize_valops prototype.
	* valprint.c: Remove _initialize_valprint prototype.
	* value.c: Remove _initialize_values prototype.
	* varobj.c: Remove _initialize_varobj prototype.
	* vax-bsd-nat.c: Remove _initialize_vaxbsd_nat prototype.
	* vax-nbsd-tdep.c: Remove _initialize_vaxnbsd_tdep prototype.
	* vax-tdep.c: Remove _initialize_vax_tdep prototype.
	* windows-nat.c: Remove _initialize_windows_nat,
	_initialize_check_for_gdb_ini, and _initialize_loadable
	prototypes.
	* windows-tdep.c: Remove _initialize_windows_tdep prototype.
	* xcoffread.c: Remove _initialize_xcoffread prototype.
	* xml-support.c: Remove _initialize_xml_support prototype.
	* xstormy16-tdep.c: Remove _initialize_xstormy16_tdep prototype.
	* xtensa-linux-nat.c: Remove _initialize_xtensa_linux_nat
	prototype.
	* xtensa-linux-tdep.c: Remove _initialize_xtensa_linux_tdep
	prototype.
	* xtensa-tdep.c: Remove _initialize_xtensa_tdep prototype.
2017-09-09 11:02:37 -07:00
Anton Kolesov a87dc45adc arc: Select CPU model properly before disassembling
Enforce CPU model for disassembler via its options, if it was specified in XML
target description, otherwise use default method of determining CPU implemented
in disassembler - scanning ELF private header.  The latter requires
disassemble_info->section to be properly initialized.  To make sure that
info->section is set in all cases this patch partially reverts [1] for ARC: it
reinstates arc_delayed_print_insn as a "print_insn" function for ARC, but
now this function only sets disassemble_info->section and then calls
default_print_insn to do the rest of the job.

Support for CPU in disassembler options for ARC has been added in [2].

[1] https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=39503f82427e22ed8e04d986ccdc8562091ec62e
[2] https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=10045478d984f9924cb945423388ba25b7dd3ffe

gdb/ChangeLog:

yyyy-mm-dd  Anton Kolesov  <anton.kolesov@synopsys.com>

	* arc-tdep.c (arc_disassembler_options): New variable.
	(arc_gdbarch_init): Set and use it. Use arc_delayed_print_insn instead
	of default_print_insn.
	(arc_delayed_print_insn): Set info->section when needed,
	use default_print_insn to retrieve a disassembler.
2017-06-16 14:54:17 +03:00
Yao Qi 39503f8242 Delegate opcodes to select disassembler in GDB
This patch changes GDB to use disassembler selected by opcodes in
default, so that we don't have to duplicate the selection logic again
in GDB side.  For example, gdb/score-tdep.c has

static int
score_print_insn (bfd_vma memaddr, struct disassemble_info *info)
{
  if (info->endian == BFD_ENDIAN_BIG)
    return print_insn_big_score (memaddr, info);
  else
    return print_insn_little_score (memaddr, info);
}

and opcodes/disassemble.c has the same logic,

    case bfd_arch_score:
      if (big)
	disassemble = print_insn_big_score;
      else
	disassemble = print_insn_little_score;

This patch removes the logic in GDB and calls
opcodes/disassemble.c:disassembler in default to select disassembler.

gdb:

2017-05-24  Yao Qi  <yao.qi@linaro.org>

	* alpha-tdep.c (alpha_gdbarch_init): Don't call
	set_gdbarch_print_insn.
	* arc-tdep.c (arc_gdbarch_init): Likewise.
	* arch-utils.c: include dis-asm.h.
	(default_print_insn): New function.
	* arch-utils.h (default_print_insn): Declare.
	* avr-tdep.c (avr_gdbarch_init): Don't call set_gdbarch_print_insn.
	* bfin-tdep.c (bfin_gdbarch_init): Likewise.
	* cris-tdep.c (cris_delayed_get_disassembler): Remove.
	(cris_gdbarch_init): Don't call set_gdbarch_print_insn.
	* frv-tdep.c (frv_gdbarch_init): Likewise.
	* ft32-tdep.c (ft32_gdbarch_init): Likewise.
	* gdbarch.sh (print_insn): Use default_print_insn.
	* gdbarch.c: Regenerated.
	* hppa-tdep.c (hppa_gdbarch_init): Likewise.
	* iq2000-tdep.c (iq2000_gdbarch_init): Likewise.
	* lm32-tdep.c (lm32_gdbarch_init): Likewise.
	* m32c-tdep.c (m32c_gdbarch_init): Likewise.
	* m32r-tdep.c (m32r_gdbarch_init): Likewise.
	* m68hc11-tdep.c (gdb_print_insn_m68hc11): Remove.
	(m68hc11_gdbarch_init): Don't call set_gdbarch_print_insn.
	* m68k-tdep.c (m68k_gdbarch_init): Likewise.
	* m88k-tdep.c (m88k_gdbarch_init): Likewise.
	* microblaze-tdep.c (microblaze_gdbarch_init): Likewise.
	* mn10300-tdep.c (mn10300_gdbarch_init): Likewise.
	* moxie-tdep.c (moxie_gdbarch_init): Likewise.
	* msp430-tdep.c (msp430_gdbarch_init): Likewise.
	* mt-tdep.c (mt_gdbarch_init): Likewise.
	* nds32-tdep.c (nds32_gdbarch_init): Likewise.
	* nios2-tdep.c (nios2_print_insn): Remove.
	(nios2_gdbarch_init): Don't call set_gdbarch_print_insn.
	* rx-tdep.c (rx_gdbarch_init): Likewise.
	* s390-linux-tdep.c (s390_gdbarch_init): Likewise.
	* score-tdep.c (score_print_insn): Remove.
	(score_gdbarch_init): Don't call set_gdbarch_print_insn.
	* sh-tdep.c (sh_gdbarch_init): Likewise.
	* sh64-tdep.c (sh64_gdbarch_init): Likewise.
	* sparc-tdep.c (sparc32_gdbarch_init): Likewise.
	* tic6x-tdep.c (tic6x_print_insn): Remove.
	(tic6x_gdbarch_init): Don't call set_gdbarch_print_insn.
	* tilegx-tdep.c (tilegx_gdbarch_init): Likewise.
	* v850-tdep.c (v850_gdbarch_init): Likewise.
	* vax-tdep.c (vax_gdbarch_init): Likewise.
	* xstormy16-tdep.c (xstormy16_gdbarch_init): Likewise.
	* xtensa-tdep.c (xtensa_gdbarch_init): Likewise.
2017-05-24 17:23:52 +01:00
Pedro Alves a121b7c1ac -Wwrite-strings: The Rest
This is the remainder boring constification that all looks more of less
borderline obvious IMO.

gdb/ChangeLog:
2017-04-05  Pedro Alves  <palves@redhat.com>

	* ada-exp.y (yyerror): Constify.
	* ada-lang.c (bound_name, get_selections)
	(ada_variant_discrim_type)
	(ada_variant_discrim_name, ada_value_struct_elt)
	(ada_lookup_struct_elt_type, is_unchecked_variant)
	(ada_which_variant_applies, standard_exc, ada_get_next_arg)
	(catch_ada_exception_command_split)
	(catch_ada_assert_command_split, catch_assert_command)
	(ada_op_name): Constify.
	* ada-lang.h (ada_yyerror, get_selections)
	(ada_variant_discrim_name, ada_value_struct_elt): Constify.
	* arc-tdep.c (arc_print_frame_cache): Constify.
	* arm-tdep.c (arm_skip_stub): Constify.
	* ax-gdb.c (gen_binop, gen_struct_ref_recursive, gen_struct_ref)
	(gen_aggregate_elt_ref): Constify.
	* bcache.c (print_bcache_statistics): Constify.
	* bcache.h (print_bcache_statistics): Constify.
	* break-catch-throw.c (catch_exception_command_1):
	* breakpoint.c (struct ep_type_description::description):
	Constify.
	(add_solib_catchpoint): Constify.
	(catch_fork_command_1): Add cast.
	(add_catch_command): Constify.
	* breakpoint.h (add_catch_command, add_solib_catchpoint):
	Constify.
	* bsd-uthread.c (bsd_uthread_state): Constify.
	* buildsym.c (patch_subfile_names): Constify.
	* buildsym.h (next_symbol_text_func, patch_subfile_names):
	Constify.
	* c-exp.y (yyerror): Constify.
	(token::oper): Constify.
	* c-lang.h (c_yyerror, cp_print_class_member): Constify.
	* c-varobj.c (cplus_describe_child): Constify.
	* charset.c (find_charset_names): Add cast.
	(find_charset_names): Constify array and add const_cast.
	* cli/cli-cmds.c (complete_command, cd_command): Constify.
	(edit_command): Constify.
	* cli/cli-decode.c (lookup_cmd): Constify.
	* cli/cli-dump.c (dump_memory_command, dump_value_command):
	Constify.
	(struct dump_context): Constify.
	(add_dump_command, restore_command): Constify.
	* cli/cli-script.c (get_command_line): Constify.
	* cli/cli-script.h (get_command_line): Constify.
	* cli/cli-utils.c (check_for_argument): Constify.
	* cli/cli-utils.h (check_for_argument): Constify.
	* coff-pe-read.c (struct read_pe_section_data): Constify.
	* command.h (lookup_cmd): Constify.
	* common/print-utils.c (decimal2str): Constify.
	* completer.c (gdb_print_filename): Constify.
	* corefile.c (set_gnutarget): Constify.
	* cp-name-parser.y (yyerror): Constify.
	* cp-valprint.c (cp_print_class_member): Constify.
	* cris-tdep.c (cris_register_name, crisv32_register_name):
	Constify.
	* d-exp.y (yyerror): Constify.
	(struct token::oper): Constify.
	* d-lang.h (d_yyerror): Constify.
	* dbxread.c (struct header_file_location::name): Constify.
	(add_old_header_file, add_new_header_file, last_function_name)
	(dbx_next_symbol_text, add_bincl_to_list)
	(find_corresponding_bincl_psymtab, set_namestring)
	(find_stab_function_addr, read_dbx_symtab, start_psymtab)
	(dbx_end_psymtab, read_ofile_symtab, process_one_symbol):
	* defs.h (command_line_input, print_address_symbolic)
	(deprecated_readline_begin_hook): Constify.
	* dwarf2read.c (anonymous_struct_prefix, dwarf_bool_name):
	Constify.
	* event-top.c (handle_line_of_input): Constify and add cast.
	* exceptions.c (catch_errors): Constify.
	* exceptions.h (catch_errors): Constify.
	* expprint.c (print_subexp_standard, op_string, op_name)
	(op_name_standard, dump_raw_expression, dump_raw_expression):
	* expression.h (op_name, op_string, dump_raw_expression):
	Constify.
	* f-exp.y (yyerror): Constify.
	(struct token::oper): Constify.
	(struct f77_boolean_val::name): Constify.
	* f-lang.c (f_word_break_characters): Constify.
	* f-lang.h (f_yyerror): Constify.
	* fork-child.c (fork_inferior): Add cast.
	* frv-tdep.c (struct gdbarch_tdep::register_names): Constify.
	(new_variant): Constify.
	* gdbarch.sh (pstring_ptr, pstring_list): Constify.
	* gdbarch.c: Regenerate.
	* gdbcore.h (set_gnutarget): Constify.
	* go-exp.y (yyerror): Constify.
	(token::oper): Constify.
	* go-lang.h (go_yyerror): Constify.
	* go32-nat.c (go32_sysinfo): Constify.
	* guile/scm-breakpoint.c (gdbscm_breakpoint_expression): Constify.
	* guile/scm-cmd.c (cmdscm_function): Constify.
	* guile/scm-param.c (pascm_param_value): Constify.
	* h8300-tdep.c (h8300_register_name, h8300s_register_name)
	(h8300sx_register_name): Constify.
	* hppa-tdep.c (hppa32_register_name, hppa64_register_name):
	Constify.
	* ia64-tdep.c (ia64_register_names): Constify.
	* infcmd.c (construct_inferior_arguments): Constify.
	(path_command, attach_post_wait): Constify.
	* language.c (show_range_command, show_case_command)
	(unk_lang_error): Constify.
	* language.h (language_defn::la_error)
	(language_defn::la_name_of_this): Constify.
	* linespec.c (decode_line_2): Constify.
	* linux-thread-db.c (thread_db_err_str): Constify.
	* lm32-tdep.c (lm32_register_name): Constify.
	* m2-exp.y (yyerror): Constify.
	* m2-lang.h (m2_yyerror): Constify.
	* m32r-tdep.c (m32r_register_names): Constify and make static.
	* m68hc11-tdep.c (m68hc11_register_names): Constify.
	* m88k-tdep.c (m88k_register_name): Constify.
	* macroexp.c (appendmem): Constify.
	* mdebugread.c (fdr_name, add_data_symbol, parse_type)
	(upgrade_type, parse_external, parse_partial_symbols)
	(mdebug_next_symbol_text, cross_ref, mylookup_symbol, new_psymtab)
	(new_symbol): Constify.
	* memattr.c (mem_info_command): Constify.
	* mep-tdep.c (register_name_from_keyword): Constify.
	* mi/mi-cmd-env.c (mi_cmd_env_path, _initialize_mi_cmd_env):
	Constify.
	* mi/mi-cmd-stack.c (list_args_or_locals): Constify.
	* mi/mi-cmd-var.c (mi_cmd_var_show_attributes): Constify.
	* mi/mi-main.c (captured_mi_execute_command): Constify and add
	cast.
	(mi_execute_async_cli_command): Constify.
	* mips-tdep.c (mips_register_name): Constify.
	* mn10300-tdep.c (register_name, mn10300_generic_register_name)
	(am33_register_name, am33_2_register_name)
	* moxie-tdep.c (moxie_register_names): Constify.
	* nat/linux-osdata.c (osdata_type): Constify fields.
	* nto-tdep.c (nto_parse_redirection): Constify.
	* objc-lang.c (lookup_struct_typedef, lookup_objc_class)
	(lookup_child_selector): Constify.
	(objc_methcall::name): Constify.
	* objc-lang.h (lookup_objc_class, lookup_child_selector)
	(lookup_struct_typedef): Constify.
	* objfiles.c (pc_in_section): Constify.
	* objfiles.h (pc_in_section): Constify.
	* p-exp.y (struct token::oper): Constify.
	(yyerror): Constify.
	* p-lang.h (pascal_yyerror): Constify.
	* parser-defs.h (op_name_standard): Constify.
	(op_print::string): Constify.
	(exp_descriptor::op_name): Constify.
	* printcmd.c (print_address_symbolic): Constify.
	* psymtab.c (print_partial_symbols): Constify.
	* python/py-breakpoint.c (stop_func): Constify.
	(bppy_get_expression): Constify.
	* python/py-cmd.c (cmdpy_completer::name): Constify.
	(cmdpy_function): Constify.
	* python/py-event.c (evpy_add_attribute)
	(gdbpy_initialize_event_generic): Constify.
	* python/py-event.h (evpy_add_attribute)
	(gdbpy_initialize_event_generic): Constify.
	* python/py-evts.c (add_new_registry): Constify.
	* python/py-finishbreakpoint.c (outofscope_func): Constify.
	* python/py-framefilter.c (get_py_iter_from_func): Constify.
	* python/py-inferior.c (get_buffer): Add cast.
	* python/py-param.c (parm_constant::name): Constify.
	* python/py-unwind.c (fprint_frame_id): Constify.
	* python/python.c (gdbpy_parameter_value): Constify.
	* remote-fileio.c (remote_fio_func_map): Make 'name' const.
	* remote.c (memory_packet_config::name): Constify.
	(show_packet_config_cmd, remote_write_bytes)
	(remote_buffer_add_string):
	* reverse.c (exec_reverse_once): Constify.
	* rs6000-tdep.c (variant::name, variant::description): Constify.
	* rust-exp.y (rustyyerror): Constify.
	* rust-lang.c (rust_op_name): Constify.
	* rust-lang.h (rustyyerror): Constify.
	* serial.h (serial_ops::name): Constify.
	* sh-tdep.c (sh_sh_register_name, sh_sh3_register_name)
	(sh_sh3e_register_name, sh_sh2e_register_name)
	(sh_sh2a_register_name, sh_sh2a_nofpu_register_name)
	(sh_sh_dsp_register_name, sh_sh3_dsp_register_name)
	(sh_sh4_register_name, sh_sh4_nofpu_register_name)
	(sh_sh4al_dsp_register_name): Constify.
	* sh64-tdep.c (sh64_register_name): Constify.
	* solib-darwin.c (lookup_symbol_from_bfd): Constify.
	* spu-tdep.c (spu_register_name, info_spu_dma_cmdlist): Constify.
	* stabsread.c (patch_block_stabs, read_type_number)
	(ref_map::stabs, ref_add, process_reference)
	(symbol_reference_defined, define_symbol, define_symbol)
	(error_type, read_type, read_member_functions, read_cpp_abbrev)
	(read_one_struct_field, read_struct_fields, read_baseclasses)
	(read_tilde_fields, read_struct_type, read_array_type)
	(read_enum_type, read_sun_builtin_type, read_sun_floating_type)
	(read_huge_number, read_range_type, read_args, common_block_start)
	(find_name_end): Constify.
	* stabsread.h (common_block_start, define_symbol)
	(process_one_symbol, symbol_reference_defined, ref_add):
	* symfile.c (get_section_index, add_symbol_file_command):
	* symfile.h (get_section_index): Constify.
	* target-descriptions.c (tdesc_type::name): Constify.
	(tdesc_free_type): Add cast.
	* target.c (find_default_run_target):
	(add_deprecated_target_alias, find_default_run_target)
	(target_announce_detach): Constify.
	(do_option): Constify.
	* target.h (add_deprecated_target_alias): Constify.
	* thread.c (print_thread_info_1): Constify.
	* top.c (deprecated_readline_begin_hook, command_line_input):
	Constify.
	(init_main): Add casts.
	* top.h (handle_line_of_input): Constify.
	* tracefile-tfile.c (tfile_write_uploaded_tsv): Constify.
	* tracepoint.c (tvariables_info_1, trace_status_mi): Constify.
	(tfind_command): Rename to ...
	(tfind_command_1): ... this and constify.
	(tfind_command): New function.
	(tfind_end_command, tfind_start_command): Adjust.
	(encode_source_string): Constify.
	* tracepoint.h (encode_source_string): Constify.
	* tui/tui-data.c (tui_partial_win_by_name): Constify.
	* tui/tui-data.h (tui_partial_win_by_name): Constify.
	* tui/tui-source.c (tui_set_source_content_nil): Constify.
	* tui/tui-source.h (tui_set_source_content_nil): Constify.
	* tui/tui-win.c (parse_scrolling_args): Constify.
	* tui/tui-windata.c (tui_erase_data_content): Constify.
	* tui/tui-windata.h (tui_erase_data_content): Constify.
	* tui/tui-winsource.c (tui_erase_source_content): Constify.
	* tui/tui.c (tui_enable): Add cast.
	* utils.c (defaulted_query): Constify.
	(init_page_info): Add cast.
	(puts_debug, subset_compare): Constify.
	* utils.h (subset_compare): Constify.
	* varobj.c (varobj_format_string): Constify.
	* varobj.h (varobj_format_string): Constify.
	* vax-tdep.c (vax_register_name): Constify.
	* windows-nat.c (windows_detach): Constify.
	* xcoffread.c (process_linenos, xcoff_next_symbol_text): Constify.
	* xml-support.c (gdb_xml_end_element): Constify.
	* xml-tdesc.c (tdesc_start_reg): Constify.
	* xstormy16-tdep.c (xstormy16_register_name): Constify.
	* xtensa-tdep.c (xtensa_find_register_by_name): Constify.
	* xtensa-tdep.h (xtensa_register_t::name): Constify.

gdb/gdbserver/ChangeLog:
2017-04-05  Pedro Alves  <palves@redhat.com>

	* gdbreplay.c (sync_error): Constify.
	* linux-x86-low.c (push_opcode): Constify.
2017-04-05 19:21:37 +01:00
Anton Kolesov fe5f7374be arc: Add prologue analysis
Add a prologue analysis that recognizes all instructions that may happen in
compiler-generated prologue, including various stores, core register moves,
subtraction and ENTER_S instruction that does a lot of prologue actions through
microcode.

Testcases cover various prologue scenarios, including instructions that are
spread across multiple 16-bit encodings (for example there are 7 encodings of
store instruction).

gdb/ChangeLog:

yyyy-mm-dd  Anton Kolesov  <anton.kolesov@synopsys.com>

	* arc-tdep.c (arc_frame_cache): Add support for prologue analysis.
	(arc_skip_prologue): Likewise.
	(arc_make_frame_cache): Likewise.
	(arc_pv_get_operand): New function.
	(arc_is_in_prologue): Likewise.
	(arc_analyze_prologue): Likewise.
	(arc_print_frame_cache): Likewise.
	(MAX_PROLOGUE_LENGTH): New constant.

gdb/doc/ChangeLog:

yyyy-mm-dd  Anton Kolesov  <anton.kolesov@synopsys.com>

	* gdb.texinfo (Synopsys ARC): Document "set debug arc 2".

gdb/testsuite/ChangeLog:

yyyy-mm-dd  Anton Kolesov  <anton.kolesov@synopsys.com>

	* gdb.arch/arc-analyze-prologue.S: New file.
	* gdb.arch/arc-analyze-prologue.exp: Likewise.
2017-03-28 21:38:32 +03:00
Anton Kolesov eea787570f arc: Add disassembler helper
Add disassembler helper for GDB, that uses opcodes structure arc_instruction
and adds convenience functions to handle instruction operands.  This interface
solves at least those problems with arc_instruction:

  * Some instructions, like "push_s", have implicit operands which are not
    directly present in arc_instruction.
  * Operands of particular meaning, like branch/jump targets, have various
    locations and meaning depending on type of branch/target.
  * Access to operand value is abstracted into a separate function, so callee
    code shouldn't bother if operand value is an immediate value or in a
    register.

Testcases included in this commit are fairly limited - they test exclusively
branch instructions, something that will be used in software single stepping.
Most of the other parts of this disassembler helper are tested during prologue
analysis testing.

gdb/ChangeLog:

yyyy-mm-dd  Anton Kolesov  <anton.kolesov@synopsys.com>

	* configure.tgt: Add arc-insn.o.
	* arc-tdep.c (arc_delayed_print_insn): Make non-static.
	(dump_arc_instruction_command): New function.
	(arc_fprintf_disasm): Likewise.
	(arc_disassemble_info): Likewise.
	(arc_insn_get_operand_value): Likewise.
	(arc_insn_get_operand_value_signed): Likewise.
	(arc_insn_get_memory_base_reg): Likewise.
	(arc_insn_get_memory_offset): Likewise.
	(arc_insn_get_branch_target): Likewise.
	(arc_insn_dump): Likewise.
	(arc_insn_get_linear_next_pc): Likewise.
	* arc-tdep.h (arc_delayed_print_insn): Add function declaration.
	(arc_disassemble_info): Likewise.
	(arc_insn_get_branch_target): Likewise.
	(arc_insn_get_linear_next_pc): Likewise.
	* NEWS: Mention new "maint print arc arc-instruction".

gdb/doc/ChangeLog:

yyyy-mm-dd  Anton Kolesov  <anton.kolesov@synopsys.com>

	* gdb.texinfo (Synopsys ARC): Add "maint print arc arc-instruction".

gdb/testsuite/ChangeLog:

yyyy-mm-dd  Anton Kolesov  <anton.kolesov@synopsys.com>

	* gdb.arch/arc-decode-insn.S: New file.
	* gdb.arch/arc-decode-insn.exp: Likewise.
2017-03-28 21:36:35 +03:00
Anton Kolesov 3be78afded arc: Add "maintenance print arc" command prefix
Add an "arc" sublist to "maintenance print" command list.  The list is empty
for now, its purpose is to contain commands that print internal state of some
ARC-specific structures.

gdb/ChangeLog:

yyyy-mm-dd  Anton Kolesov  <anton.kolesov@synopsys.com>

	* arc-tdep (maintenance_print_arc_list): New variable.
	(maintenance_print_arc_command): New function.
2017-03-28 21:02:34 +03:00
Anton Kolesov 296ec4fa2a arc: Align internal regnums with architectural regnums
Add ARC_LIMM_REGNUM to arc_regnum enumeration and assign a number 62 to it.
This ensures that for core registers internal register numbers in this enum are
the same as architectural numbers.  This allows to use internal register
numbers in the contexts where architectural number is implied, for example when
disassembling instruction during prologue analysis.

gdb/ChangeLog:

yyyy-mm-dd  Anton Kolesov  <anton.kolesov@synopsys.com>

	* arc-tdep.c (core_v2_register_names, core_arcompact_register_names)
	Add "limm" and "reserved".
	(arc_cannot_fetch_register, arc_cannot_store_register): Add
	ARC_RESERVED_REGNUM and ARC_LIMM_REGNUM.
	* arc-tdep.h (arc_regnum): Likewise.
2017-03-28 21:01:44 +03:00
Joel Brobecker 61baf725ec update copyright year range in GDB files
This applies the second part of GDB's End of Year Procedure, which
updates the copyright year range in all of GDB's files.

gdb/ChangeLog:

        Update copyright year range in all GDB files.
2017-01-01 10:52:34 +04:00
Yao Qi 04180708ef Remove GDBARCH_BREAKPOINT_MANIPULATION and SET_GDBARCH_BREAKPOINT_MANIPULATION
Both of them are used in conversion.  We can remove them since the
conversion is done.

There are many architectures only have one breakpoint instruction,
so their gdbarch methods breakpoint_kind_from_pc and
sw_breakpoint_from_kind look very similar.  Instead of macro, we
use template "template <size_t, const gdb_byte *> struct bp_manipulation"
for these architectures.  In order to use template, I also change
breakpoint instruction of type "static const gdb_byte[]" to
"constexpr gdb_byte[]", and rename them to ARCH_break_insn.

gdb:

2016-11-03  Yao Qi  <yao.qi@linaro.org>
	    Pedro Alves <palves@redhat.com>

	* aarch64-tdep.c (aarch64_default_breakpoint): Change it to
	constexpr.  Don't use GDBARCH_BREAKPOINT_MANIPULATION.
	(aarch64_gdbarch_init): Don't use
	SET_GDBARCH_BREAKPOINT_MANIPULATION.
	* alpha-tdep.c (break_insn): Rename to alpha_break_insn.
	Don't use GDBARCH_BREAKPOINT_MANIPULATION.
	(alpha_gdbarch_init): Don't use
	SET_GDBARCH_BREAKPOINT_MANIPULATION.
	* arc-tdep.c (arc_gdbarch_init): Don't use
	SET_GDBARCH_BREAKPOINT_MANIPULATION.
	* arch-utils.h (GDBARCH_BREAKPOINT_MANIPULATION): Remove.
	(struct bp_manipulation): New.
	(SET_GDBARCH_BREAKPOINT_MANIPULATION): Remove.
	(struct bp_manipulation_endian): New.
	(BP_MANIPULATION): New.
	(BP_MANIPULATION_ENDIAN): New.
	* arm-tdep.c (arm_gdbarch_init): Don't use
	SET_GDBARCH_BREAKPOINT_MANIPULATION.
	* avr-tdep.c (avr_break_insn): Change it constexpr.
	(avr_gdbarch_init): Don't use
	SET_GDBARCH_BREAKPOINT_MANIPULATION.
	* bfin-tdep.c (bfin_gdbarch_init): Likewise.
	* cris-tdep.c (cris_gdbarch_init): Likewise.
	* frv-tdep.c (breakpoint): Rename it to frv_break_insn, and
	change its type to constexpr.  Don't use
	GDBARCH_BREAKPOINT_MANIPULATION.
	(frv_gdbarch_init): Don't use
	SET_GDBARCH_BREAKPOINT_MANIPULATION.
	* ft32-tdep.c (breakpoint): Rename it to ft32_break_insn and
	change its type to constexpr.  Don't use
	GDBARCH_BREAKPOINT_MANIPULATION.
	(ft32_gdbarch_init): Don't use
	SET_GDBARCH_BREAKPOINT_MANIPULATION.
	* h8300-tdep.c (breakpoint): Rename it to h8300_break_insn.
	Don't use GDBARCH_BREAKPOINT_MANIPULATION.
	(h8300_gdbarch_init): Don't use
	SET_GDBARCH_BREAKPOINT_MANIPULATION.
	* hppa-tdep.c (breakpoint): Rename it to h8300_break_insn.
	Don't use GDBARCH_BREAKPOINT_MANIPULATION.
	(hppa_gdbarch_init): Don't use
	SET_GDBARCH_BREAKPOINT_MANIPULATION.
	* i386-tdep.c (break_insn): Rename it to i386_break_insn.
	Don't use GDBARCH_BREAKPOINT_MANIPULATION.
	(i386_gdbarch_init): Don't use
	SET_GDBARCH_BREAKPOINT_MANIPULATION.
	* iq2000-tdep.c (iq2000_gdbarch_init): Don't use
	SET_GDBARCH_BREAKPOINT_MANIPULATION.
	* lm32-tdep.c (breakpoint): Rename it to lm32_break_insn and
	change its type to constexpr.  Don't use
	GDBARCH_BREAKPOINT_MANIPULATION.
	(lm32_gdbarch_init): Don't use
	SET_GDBARCH_BREAKPOINT_MANIPULATION.
	* m32c-tdep.c (break_insn): Rename it to m32c_break_insn and change
	its type to constexpr.  Don't use GDBARCH_BREAKPOINT_MANIPULATION.
	(m32c_gdbarch_init): Don't use
	SET_GDBARCH_BREAKPOINT_MANIPULATION.
	* m32r-tdep.c (m32r_gdbarch_init): Likewise.
	* m68hc11-tdep.c (breakpoint): Rename it to m68hc11_break_insn and
	change its type to constexpr.  Don't use GDBARCH_BREAKPOINT_MANIPULATION.
	(m68hc11_gdbarch_init): Don't use SET_GDBARCH_BREAKPOINT_MANIPULATION.
	* m68k-tdep.c (break_insn): Rename it to m68k_break_insn and change
	its type to constexpr.  Don't use GDBARCH_BREAKPOINT_MANIPULATION.
	(m68k_gdbarch_init):  Don't use
	SET_GDBARCH_BREAKPOINT_MANIPULATION.
	* m88k-tdep.c (break_insn): Rename it to m88k_break_insn and change
	its type to constexpr.  Don't use GDBARCH_BREAKPOINT_MANIPULATION.
	(m88k_gdbarch_init): Don't use
	SET_GDBARCH_BREAKPOINT_MANIPULATION.
	* mep-tdep.c (breakpoint): Rename it to mep_break_insn and change
	its type to constexpr.  Don't use GDBARCH_BREAKPOINT_MANIPULATION.
	(mep_gdbarch_init): Don't use
	SET_GDBARCH_BREAKPOINT_MANIPULATION.
	* microblaze-tdep.c (break_insn): Rename it to
	microblaze_break_insn and change its type to constexpr.  Don't use
	GDBARCH_BREAKPOINT_MANIPULATION.
	(microblaze_gdbarch_init): Don't use
	SET_GDBARCH_BREAKPOINT_MANIPULATION.
	* mips-tdep.c (mips_gdbarch_init): Likewise.
	* mn10300-tdep.c (breakpoint): Rename it to mn10300_break_insn and
	change its type to constexpr.  Don't use
	GDBARCH_BREAKPOINT_MANIPULATION.
	(mn10300_gdbarch_init): Don't use
	SET_GDBARCH_BREAKPOINT_MANIPULATION.
	* moxie-tdep.c (breakpoint): Rename it to moxie_break_insn and
	change its type to constexpr.  Don't use
	GDBARCH_BREAKPOINT_MANIPULATION.
	(moxie_gdbarch_init): Don't use
	SET_GDBARCH_BREAKPOINT_MANIPULATION.
	* msp430-tdep.c (breakpoint): Rename it to msp430_break_insn
	and change its type to constexpr.  Don't use
	GDBARCH_BREAKPOINT_MANIPULATION.
	(msp430_gdbarch_init): Don't use
	SET_GDBARCH_BREAKPOINT_MANIPULATION.
	* mt-tdep.c (mt_gdbarch_init): Likewise.
	* nds32-tdep.c (break_insn): Rename it to nds32_break_insn
	and change its type to constexpr.  Don't use
	GDBARCH_BREAKPOINT_MANIPULATION.
	(nds32_gdbarch_init): Don't use
	SET_GDBARCH_BREAKPOINT_MANIPULATION.
	* nios2-tdep.c (nios2_gdbarch_init): Likewise.
	* rl78-tdep.c (breakpoint): Rename it to rl78_break_ins
	and change its type to rl78_break_insn.  Don't use
	GDBARCH_BREAKPOINT_MANIPULATION.
	(rl78_gdbarch_init): Don't use
	SET_GDBARCH_BREAKPOINT_MANIPULATION.
	* rs6000-tdep.c (big_breakpoint): Change its type to
	constexpr.
	(little_breakpoint): Likewise.
	Don't use GDBARCH_BREAKPOINT_MANIPULATION_ENDIAN.
	(rs6000_gdbarch_init): Don't use
	SET_GDBARCH_BREAKPOINT_MANIPULATION.
	* rx-tdep.c (breakpoint): Rename it to rx_break_insn and
	change its type to constexpr.  Don't use
	GDBARCH_BREAKPOINT_MANIPULATION.
	(rx_gdbarch_init): Don't use
	SET_GDBARCH_BREAKPOINT_MANIPULATION.
	* s390-linux-tdep.c (breakpoint): Rename it to s390_break_insn
	and change its type to constexpr.  Don't use
	GDBARCH_BREAKPOINT_MANIPULATION
	(s390_gdbarch_init): Don't use
	SET_GDBARCH_BREAKPOINT_MANIPULATION.
	* score-tdep.c (score_gdbarch_init): Likewise.
	* sh-tdep.c (sh_gdbarch_init): Likewise.
	* sh64-tdep.c (sh64_gdbarch_init): Likewise.
	* sparc-tdep.c (break_insn): Rename it to sparc_break_insn
	and change its type to constexpr.  Don't use
	GDBARCH_BREAKPOINT_MANIPULATION.
	(sparc32_gdbarch_init): Don't use
	SET_GDBARCH_BREAKPOINT_MANIPULATION.
	* spu-tdep.c (breakpoint): Rename it to spu_break_insn and change
	its type to constexpr.  Don't use
	GDBARCH_BREAKPOINT_MANIPULATION.
	(spu_gdbarch_init): Don't use
	SET_GDBARCH_BREAKPOINT_MANIPULATION.
	* tic6x-tdep.c (tic6x_gdbarch_init): Likewise.
	* tilegx-tdep.c (breakpoint): Rename it to tilegx_break_insn
	and change its type to constexpr.  Don't use
	GDBARCH_BREAKPOINT_MANIPULATION.
	(tilegx_gdbarch_init): Don't use
	SET_GDBARCH_BREAKPOINT_MANIPULATION.
	* v850-tdep.c (v850_gdbarch_init): Likewise.
	* vax-tdep.c (break_insn): Rename it to vax_break_insn and
	change its type to constexpr.
	Don't use GDBARCH_BREAKPOINT_MANIPULATION.
	(vax_gdbarch_init): Don't use
	SET_GDBARCH_BREAKPOINT_MANIPULATION.
	* xstormy16-tdep.c (breakpoint): Rename it to
	xstormy16_break_insn and change its type to constexpr.
	Don't use GDBARCH_BREAKPOINT_MANIPULATION.
	(xstormy16_gdbarch_init): Don't use
	SET_GDBARCH_BREAKPOINT_MANIPULATION.
	* xtensa-tdep.c (xtensa_gdbarch_init): Likewise.
2016-11-03 14:35:14 +00:00
Yao Qi 22f13eb869 Add default_breakpoint_from_pc
This patch adds the default implementation of gdbarch breakpoint_from_pc,
which is,

const gdb_byte *
default_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr,
                           int *lenptr)
{
  int kind = gdbarch_breakpoint_kind_from_pc (gdbarch, pcptr);

  return gdbarch_sw_breakpoint_from_kind (gdbarch, kind, lenptr);
}

so gdbarch can only defines sw_breakpoint_from_kind and
breakpoint_kind_from_pc.

gdb:

2016-11-03  Yao Qi  <yao.qi@linaro.org>

	* arch-utils.c (default_breakpoint_from_pc): New function.
	* arch-utils.h (GDBARCH_BREAKPOINT_FROM_PC): Remove.
	(GDBARCH_BREAKPOINT_MANIPULATION): Don't use
	GDBARCH_BREAKPOINT_FROM_PC.
	(SET_GDBARCH_BREAKPOINT_MANIPULATION): Don't call
	set_gdbarch_breakpoint_from_pc.
	(default_breakpoint_from_pc): Remove declaration.
	* gdbarch.sh (breakpoint_from_pc): Add its default implementation.
	* gdbarch.c, gdbarch.h: Regenerate.
	* arm-tdep.c: Don't use GDBARCH_BREAKPOINT_FROM_PC.
	* arc-tdep.c, bfin-tdep.c, cris-tdep.c, iq2000-tdep.c: Likewise.
	* m32r-tdep.c, mips-tdep.c, mt-tdep.c: Likewise.
	* nios2-tdep.c, score-tdep.c, sh-tdep.c: Likewise.
	* sh64-tdep.c, tic6x-tdep.c, v850-tdep.c, xtensa-tdep.c: Likewise.
2016-11-03 14:35:14 +00:00
Yao Qi d19280adb5 Split breakpoint_from_pc to breakpoint_kind_from_pc and sw_breakpoint_from_kind
We convert each ARCH_breakpoint_from_pc to ARCH_breakpoint_kind_from_pc
and ARCH_sw_breakpoint_from_kind.  Note that gdbarch doesn't have methods
breakpoint_kind_from_pc and sw_breakpoint_from_kind so far.

gdb:

2016-11-03  Yao Qi  <yao.qi@linaro.org>

	* arch-utils.h (GDBARCH_BREAKPOINT_FROM_PC): New macro.
	(GDBARCH_BREAKPOINT_MANIPULATION_ENDIAN): New macro.
	* arm-tdep.c (arm_breakpoint_from_pc): Remove.
	(arm_breakpoint_kind_from_pc): New function.
	(arm_sw_breakpoint_from_kind): New function.
	(arm_breakpoint_from_pc): Call arm_breakpoint_kind_from_pc
	and arm_sw_breakpoint_from_kind.
	Use GDBARCH_BREAKPOINT_FROM_PC.
	(arm_remote_breakpoint_from_pc): Call
	arm_breakpoint_kind_from_pc.
	(arm_gdbarch_init): Replace set_gdbarch_breakpoint_from_pc
	with SET_GDBARCH_BREAKPOINT_MANIPULATION.
	* arc-tdep.c: Likewise.
	* bfin-tdep.c: Likewise.
	* cris-tdep.c: Likewise.
	* iq2000-tdep.c: Likewise.
	* m32r-tdep.c: Likewise.
	* mips-tdep.c: Likewise.
	* mt-tdep.c: Likewise.
	* nios2-tdep.c: Likewise.
	* rs6000-tdep.c: Likewise.
	* score-tdep.c: Likewise.
	* sh-tdep.c: Likewise.
	* sh64-tdep.c: Likewise.
	* tic6x-tdep.c: Likewise.
	* v850-tdep.c: Likewise.
	* xtensa-tdep.c: Likewise.
2016-11-03 14:35:13 +00:00
Anton Kolesov aaf43c4882 arc: Add evaluation of long jump targets
Standard get_longjmp_target implementation, similar to what is in arm-tdep.c.
Actual value of jb_pc should be set in init_osabi methods of particular OS/ABI
implementations.

gdb/ChangeLog:

	* arc-tdep.h (struct gdbarch_tdep) <jb_pc>: New field.
	* arc-tdep.c (arc_get_longjmp_target): New function.
	(arc_gdbarch_init): Set get_longjmp_target if jb_pc is non-negative.
	(arc_dump_tdep): Print jb_pc.
2016-10-12 14:47:45 +03:00
Anton Kolesov b845c31ecc arc: Add a gdbarch_tdep structure
Add target-specific structure gdbarch_tdep for ARC.

gdb/ChangeLog:

	* arc-tdep.h (struct gdbarch_tdep): New.
	* arc-tdep.c (arc_gdbarch_init): Allocate gdbarch_tdep.
2016-10-12 14:47:09 +03:00
Anton Kolesov ed2f09e183 arc: Remove annoying debug message
The logging message is called too often - once for each register when it's
value has to be evaluated. This floods the screen for commands like "info
register all", but doesn't give really any help at debugging GDB issues.
Between increasing the debug level of this message and removing it altogether I
think that removing it is preferable.

gdb/ChangeLog:

	arc-tdep.c (arc_frame_prev_register): Remove annoying log message.
2016-10-05 13:07:44 +03:00
Anton Kolesov fa42dd2e83 arc: Fix ARI warning for printf(%p)
Replace printf ("%p") with printf ("%s", host_address_to_string ()). Printing
host addrss might make sense here because pointers can be null and this would
affect how function behaves.

This particular warning is printed only when option -Wari is passed to
contrib/ari/gdb_ari.sh

gdb/ChangeLog:

	* arc-tdep.c: Fix ARI warning for printf(%p).
2016-09-22 14:26:44 +03:00
Anton Kolesov ad0a504f7e arc: New Synopsys ARC port
ARC is a family of licensable processors developed by Synopsys.

This is an initial patch that doesn't yet support some of the features, that
are already available in Synopsys' fork of GDB, namely:

  * longjmp support
  * signal frame handling
  * prologue analysis
  * Linux targets support
  * native Linux support

ARC cores are configurable and extensible, which means from debugger
perspective that some registers and debug capabilities are optional, therefore
it is up to the GDB stub to determine exact list of register available on
target and supply it to GDB via XML target descriptions.  List of registers
that is known to GDB and is required is intentionally kept small to simplify
requirements to GDB stub and implementation of a GDB client.

gdb/ChangeLog:

	* Makefile.in (ALL_TARGET_OBS): Add arc-tdep.o.
	(HFILES_NO_SRCDIR): Add arc-tdep.h.
	(ALLDEPFILES): Add arc-tdep.c.
	* NEWS: Mention new ARC port.
	* configure.tgt: Add ARC.
	* arc-tdep.c: New file.
	* arc-tdep.h: New file.
	* features/Makefile (XMLTOC): Add arc-v2.xml and arc-arcompact.xml.
	* features/arc-v2.xml: New file.
	* features/arc-v2.c: New file (generated).
	* features/arc-arcompact.xml: New file.
	* features/arc-arcompact.c: New file (generated).

gdb/doc/ChangeLog:

	* gdb.texinfo (Embedded Processors): Document ARC.
	(Synopsys ARC): New section.
	(Standard Target Features): Document ARC features.
	(ARC Features): New section.

gdb/testsuite/ChangeLog:

	* gdb.xml/tdesc-regs.exp: set core-regs for arc*-*-elf32.
2016-09-21 21:07:06 +03:00
Andrew Cagney 1a14e23479 2002-12-16 Andrew Cagney <ac131313@redhat.com>
* config/arc/arc.mt, config/arc/tm-arc.h: Delete.
	* config/d30v/d30v.mt, config/d30v/tm-d30v.h: Delete.
	* config/fr30/fr30.mt, config/fr30/tm-fr30.h: Delete.
	* config/i386/i386aix.mh, config/i386/i386aix.mt: Delete.
	* config/i386/i386m3.mh, config/i386/i386m3.mt: Delete.
	* config/i386/i386mach.mh, config/i386/i386os9k.mt: Delete.
	* config/i386/nm-i386aix.h, config/i386/nm-i386mach.h: Delete.
	* config/i386/nm-m3.h, config/i386/tm-i386aix.h: Delete.
	* config/i386/tm-i386m3.h, config/i386/tm-i386mk.h: Delete.
	* config/i386/xm-i386aix.h, config/i386/xm-i386m3.h: Delete.
	* config/i386/xm-i386mach.h, config/i386/xm-i386mk.h: Delete.
	* config/i960/mon960.mt, config/i960/nindy960.mt: Delete.
	* config/i960/tm-i960.h, config/i960/tm-mon960.h: Delete.
	* config/i960/tm-nindy960.h, config/i960/tm-vx960.h: Delete.
	* config/i960/vxworks960.mt, config/m68k/apollo68b.mh: Delete.
	* config/m68k/apollo68b.mt, config/m68k/apollo68v.mh: Delete.
	* config/m68k/hp300bsd.mh, config/m68k/hp300bsd.mt: Delete.
	* config/m68k/hp300hpux.mh, config/m68k/hp300hpux.mt: Delete.
	* config/m88k/delta88.mh, config/m88k/delta88.mt: Delete.
	* config/m88k/delta88v4.mh, config/m88k/delta88v4.mt: Delete.
	* config/m88k/m88k.mh, config/m88k/m88k.mt: Delete.
	* config/m88k/nm-delta88v4.h, config/m88k/nm-m88k.h: Delete.
	* config/m88k/tm-delta88.h, config/m88k/tm-delta88v4.h: Delete.
	* config/m88k/tm-m88k.h, config/m88k/xm-delta88.h: Delete.
	* config/m88k/xm-dgux.h: Delete.
	* fr30-tdep.c, i386aix-nat.c, i386m3-nat.c: Delete.
	* i386mach-nat.c, i960-tdep.c, m88k-nat.c: Delete.
	* os9kread.c, remote-bug.c, remote-nindy.c: Delete.
	* remote-nrom.c, remote-os9k.c, remote-vx960.c: Delete.
	* d30v-tdep.c, arc-tdep.c, cxux-nat.c, dst.h, dstread.c: Delete.
	* ch-exp.c, ch-lang.c, ch-lang.h, ch-typeprint.c: Delete.
	* ch-valprint.c: Delete.
2002-12-16 20:39:23 +00:00
Andrew Cagney eb4c54a288 2002-08-06 Andrew Cagney <cagney@redhat.com>
* configure.tgt: Make arc-*-* obsolete.
* NEWS: Mention that arc-*-* has been identifed as obsolete.
* MAINTAINERS: Make arc-elf obsolete.
* arc-tdep.c: Make file obsolete.
* config/arc/arc.mt: Ditto.
* config/arc/tm-arc.h: Ditto.
2002-08-06 14:12:47 +00:00
Andrew Cagney 5f8a318830 2002-07-30 Andrew Cagney <ac131313@redhat.com>
* symtab.h: Replace #include "gdb_obstack.h" with opaque
declaration.
* cli/cli-cmds.c, cli/cli-script.c: Include "gdb_string.h".
* gnu-v3-abi.c, arc-tdep.c, cli/cli-decode.c: Ditto.
* avr-tdep.c, mon960-rom.c, i960-tdep.c: Ditto.
* arch-utils.c, cli/cli-setshow.c: Unconditionally include
"gdb_string.h".
* Makefile.in (cli-script.o, cli-cmds.o): Update dependencies.
(gnu-v3-abi.o, cli-setshow.o, i960-tdep.o): Ditto.
(cli-decode.o, mi-cmd-var.o, mi-cmd-disas.o): Ditto.
(avr-tdep.o, mon960-rom.o): Ditto.
(aout_stabs_gnu_h): Define.
(symtab_h): Remove $(gdb_obstack_h).
2002-07-30 13:45:15 +00:00
Andrew Cagney 6cc1c0a886 * config/sparc/tm-sparc.h (sparc_skip_prologue): Restore
declaration
* arc-tdep.c (arc_prologue_frameless_p): Fix syntax error.
2002-04-22 02:18:59 +00:00
David S. Miller 9319a2feca 2002-04-21 David S. Miller <davem@redhat.com>
* arch-utils.c (generic_prologue_frameless_p): Kill
	SKIP_PROLOGUE_FRAMELESS_P code.
	* config/arc/tm-arc.h (SKIP_PROLOGUE_FRAMELESS_P): Delete
	references.
	(PROLOGUE_FRAMELESS_P, arc_prologue_frameless_p): New.
	* arc-tdep.c (arc_prologue_frameless_p): Implement.
	* config/arc/tm-sparc.h (SKIP_PROLOGUE_FRAMELESS_P): Delete
	references.
	(PROLOGUE_FRAMELESS_P, sparc_prologue_frameless_p): New.
	* sparc-tdep.c (sparc_prologue_frameless_p): Implement.
	(sparc_gdbarch_init): Pass it to
	set_gdbarch_prologue_frameless_p.
2002-04-22 00:27:39 +00:00
Richard Earnshaw a48442a050 * arc-tdep.c (get_longjmp_target): Only compile this function if JB_PC
is defined.
* sparc-tdep.c (get_longjmp_target): Likewise.
2002-02-20 10:42:59 +00:00
Andrew Cagney 9f60d481c2 * cli/cli-decode.c (do_cfunc, set_cmd_cfunc): New functions.
(do_sfunc, set_cmd_sfunc): New functions.

* command.h (struct cmd_list_element): Add field func.
* cli/cli-decode.h (struct cmd_list_element): Ditto.
* command.h (set_cmd_sfunc, set_cmd_cfunc): Declare.
* cli/cli-decode.h: Ditto.

* cli/cli-decode.c (help_cmd): Test for func not cfunc/sfunc.
(help_all, help_cmd_list): Ditto.
(find_cmd, complete_on_cmdlist): Ditto.
* top.c (execute_command): Ditto.

* cli/cli-setshow.c (do_setshow_command): Call func instead of
function.sfunc.

* infcmd.c (notice_args_read): Fix function signature.

* cli/cli-cmds.c (init_cli_cmds): Use set_cmd_sfunc.
* cli/cli-decode.c (add_set_cmd): Ditto.
* utils.c (initialize_utils): Ditto.
* maint.c (_initialize_maint_cmds): Ditto.
* infrun.c (_initialize_infrun): Ditto.
* demangle.c (_initialize_demangler): Ditto.
* remote.c (add_packet_config_cmd): Ditto.
* mips-tdep.c (_initialize_mips_tdep): Ditto.
* cris-tdep.c (_initialize_cris_tdep): Ditto.
* proc-api.c (_initialize_proc_api): Ditto.
* kod.c (_initialize_kod): Ditto.
* valprint.c (_initialize_valprint): Ditto.
* top.c (init_main): Ditto.
* infcmd.c (_initialize_infcmd): Ditto.
* corefile.c (_initialize_core): Ditto.
* arm-tdep.c (_initialize_arm_tdep): Ditto.
* arch-utils.c (initialize_current_architecture): Ditto.
(_initialize_gdbarch_utils): Ditto.
* alpha-tdep.c (_initialize_alpha_tdep): Ditto.

* cli/cli-decode.c (add_cmd): Use set_cmd_cfunc.
* wince.c (_initialize_inftarg): Ditto.
* symfile.c (_initialize_symfile): Ditto.
* mips-tdep.c (_initialize_mips_tdep): Ditto.
* language.c (_initialize_language): Ditto.
* arc-tdep.c (_initialize_arc_tdep): Ditto.
2002-02-05 04:37:23 +00:00
Kevin Buettner b6ba6518e9 Update/correct copyright notices. 2001-03-06 08:22:02 +00:00
Andrew Cagney 4e052eda91 Create new file regcache.h. Update all uses. 2001-03-01 01:39:22 +00:00
Andrew Cagney 4fcf66da88 Replace strsave() with xstrdup(). 2001-01-31 01:24:03 +00:00
Nick Clifton ea8d0b28e6 Add new arc core numbers. 2001-01-19 04:08:52 +00:00
Kevin Buettner fba45db2fa Protoization. 2000-07-30 01:48:28 +00:00
Kevin Buettner a14ed312fd PARAMS removal. 2000-05-28 01:12:42 +00:00
Jason Molenda c2d11a7da0 import gdb-1999-12-06 snapshot 1999-12-07 03:56:43 +00:00
Stan Shebs d4f3574e77 import gdb-1999-09-08 snapshot 1999-09-09 00:02:17 +00:00
Jason Molenda c5aa993b1f import gdb-1999-07-07 post reformat 1999-07-07 20:19:36 +00:00
Stan Shebs b83266a0e1 import gdb-19990504 snapshot 1999-05-05 14:45:51 +00:00
Stan Shebs 7a292a7adf import gdb-19990422 snapshot 1999-04-26 18:34:20 +00:00
Stan Shebs c906108c21 Initial creation of sourceware repository 1999-04-16 01:35:26 +00:00
Stan Shebs 071ea11e85 Initial creation of sourceware repository 1999-04-16 01:34:07 +00:00
Andrew Cagney 0233186932 CARP:
STEP_SKIPS_DELAY - add STEP_SKIPS_DELAY_P and rewrite use removing
  #ifdef's.
NO_SINGLE_STEP - replace with SOFTWARE_SINGLE_STEP_P +
  SOFTWARE_SINGLE_STEP.  Replace global variable one_stepped with static
  singlestep_breakpoints_inserted_p.  Cleanup infrun.c (scary!).
1998-11-27 23:35:08 +00:00
David Edelsohn eb631f3133 arc port no longer sanitized. 1997-09-10 00:30:05 +00:00
Fred Fish b607efe714 See gdb ChangeLog entry with header:
Thu Jul 25 19:41:31 1996  Fred Fish  <fnf@cygnus.com>

for a rather huge set of changes.  I was going to put them here, but it
made cvs dump core.  :-(
1996-07-26 03:01:51 +00:00
Fred Fish 6c9638b444 Update FSF address. 1995-08-02 03:41:12 +00:00
David Edelsohn 4f36d4ab73 * arc-tdep.c (arc_bfd_mach_type): New static global.
(codestream_fill): Handle byte order differences.
	(setup_prologue_scan): Don't read stdarg function's "sub sp,sp,N".
	(arc_get_frame_setup): Read it here.
	(arc_frame_saved_pc): And here.
	(arc_print_insn): New function.
	(arc_set_cpu_type): Set arc_bfd_mach_type.  Don't set tm_print_insn.
	(_initialize_arc_tdep): Set tm_print_insn to arc_print_insn.
1995-06-02 18:29:46 +00:00
David Edelsohn f0d795faf6 * arc-tdep.c: #include "gdbcmd.h".
(codestream_seek): Pass CORE_ADDR.
	(arc_cpu_type, tmp_arc_cpu_type, arc_cpu_type_table): New globals.
	(debug_pipeline_p): Likewise.
	(X_...): Instruction field access macros.
	(BUILD_INSN): Define.
	(codestream_tell): Allow for stream elements > 1 byte.
	(codestream_fill): Likewise.
	(setup_prologue_scan): New function.
	(arc_get_frame_setup): Call it.  Update to current spec
	regarding prologues.  Use BUILD_INSN.
	(skip_prologue): New argument `frameless_p'.  Use BUILD_INSN.
	(arc_frame_saved_pc): New function.
	(frame_find_saved_regs): Use BUILD_INSN.
	(get_insn_type, single_step): New functions.
	(one_stepped): New global.
	(arc_set_cpu_type_command, arc_show_cpu_type_command): New functions.
	(arc_set_cpu_type): New function.
	(_initialize_arc_tdep): Define new `set' commands `cpu',
	`displaypipeline', and `debugpipeline'.
	* remote-arc.c (break_insn): Add bi-endian support.
	(arc_insert_breakpoint): Likewise.
	(arc_remove_breakpoint): Likewise.
	(switch_command): Delete.
	* arc/tm-arc.h (TARGET_BYTE_ORDER): Delete.
	(TARGET_BYTE_ORDER_SELECTABLE): Define.
	(DEFAULT_ARC_CPU_TYPE): Define.
	(SKIP_PROLOGUE_FRAMELESS_P): Define.
	(BREAKPOINT): Delete.
	(BIG_BREAKPOINT, LITTLE_BREAKPOINT): Define.
	(DECR_PC_AFTER_BREAK): Change to 8.
	(NO_SINGLE_STEP): Define.
	(ARC_PC_TO_REAL_ADDRESS): Define.
	(SAVED_PC_AFTER_CALL): Use it.
	(NUM_REGS, REGISTER_BYTES): Fix.
	(FRAME_SAVED_PC): Call arc_frame_saved_pc.
	(FRAME_LOCALS_ADDRESS): Fix.
1995-04-12 15:47:39 +00:00
Kung Hsu abed6bc2e1 * arc-tdep.c (_initialize_arc_tdep): set tm_print_insn according to
processor.
        * remote-arc.c (arc_wait): when a processor stops, stop other two
        processors too.
        * remote-arc.c (switch_command): switch tm_print_insn.
1995-03-01 01:39:12 +00:00
Stan Shebs 9c4ecee67e * i386-tdep.c (_initialize_i386_tdep): Put void decl on separate
line, so init.c generation works correctly.
start-sanitize-arc
	* arc-tdep.c (_initialize_arc_tdep): Ditto.
end-sanitize-arc
1995-02-07 03:01:16 +00:00
Kung Hsu 249abc9805 * arc-tdep.c: new target dependent codes for arc processor.
* remote-arc.c: new file for arc-specific protocol through
        parallel line.
        * ser-go32-para.c: new file for go32 parallel port communication.
        * .Sanitize: sanitize arc specific files out.
1995-02-03 00:23:22 +00:00