From 39503f82427e22ed8e04d986ccdc8562091ec62e Mon Sep 17 00:00:00 2001 From: Yao Qi Date: Wed, 24 May 2017 17:23:52 +0100 Subject: [PATCH] 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 * 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. --- gdb/ChangeLog | 48 +++++++++++++++++++++++++++++++++++++++++++ gdb/alpha-tdep.c | 3 --- gdb/arc-tdep.c | 2 -- gdb/arch-utils.c | 20 ++++++++++++++++++ gdb/arch-utils.h | 2 ++ gdb/avr-tdep.c | 1 - gdb/bfin-tdep.c | 1 - gdb/cris-tdep.c | 18 ---------------- gdb/frv-tdep.c | 1 - gdb/ft32-tdep.c | 2 -- gdb/gdbarch.c | 4 ++-- gdb/gdbarch.sh | 2 +- gdb/hppa-tdep.c | 2 -- gdb/iq2000-tdep.c | 1 - gdb/lm32-tdep.c | 3 --- gdb/m32c-tdep.c | 3 --- gdb/m32r-tdep.c | 2 -- gdb/m68hc11-tdep.c | 11 ---------- gdb/m68k-tdep.c | 4 ---- gdb/m88k-tdep.c | 2 -- gdb/microblaze-tdep.c | 2 -- gdb/mn10300-tdep.c | 2 -- gdb/moxie-tdep.c | 2 -- gdb/msp430-tdep.c | 3 --- gdb/mt-tdep.c | 1 - gdb/nds32-tdep.c | 2 -- gdb/nios2-tdep.c | 14 ------------- gdb/rx-tdep.c | 2 -- gdb/s390-linux-tdep.c | 2 -- gdb/score-tdep.c | 10 --------- gdb/sh-tdep.c | 1 - gdb/sh64-tdep.c | 2 -- gdb/sparc-tdep.c | 2 -- gdb/tic6x-tdep.c | 10 --------- gdb/tilegx-tdep.c | 2 -- gdb/v850-tdep.c | 2 -- gdb/vax-tdep.c | 2 -- gdb/xstormy16-tdep.c | 2 -- gdb/xtensa-tdep.c | 2 -- 39 files changed, 73 insertions(+), 124 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index c8bd6fd783e..fa6cf2c2dfd 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,51 @@ +2017-05-24 Yao Qi + + * 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-23 John Baldwin * mips-fbsd-tdep.c (MIPS_PC_REGNUM): Remove. diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c index d62566c4b0a..b1bc6a1e049 100644 --- a/gdb/alpha-tdep.c +++ b/gdb/alpha-tdep.c @@ -1798,9 +1798,6 @@ alpha_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* Prologue heuristics. */ set_gdbarch_skip_prologue (gdbarch, alpha_skip_prologue); - /* Disassembler. */ - set_gdbarch_print_insn (gdbarch, print_insn_alpha); - /* Call info. */ set_gdbarch_return_value (gdbarch, alpha_return_value); diff --git a/gdb/arc-tdep.c b/gdb/arc-tdep.c index 4f866a9ccaf..d9ee5c69fd8 100644 --- a/gdb/arc-tdep.c +++ b/gdb/arc-tdep.c @@ -2013,8 +2013,6 @@ arc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_frame_align (gdbarch, arc_frame_align); - set_gdbarch_print_insn (gdbarch, arc_delayed_print_insn); - set_gdbarch_cannot_step_breakpoint (gdbarch, 1); /* "nonsteppable" watchpoint means that watchpoint triggers before diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c index b1cec80bcac..c011b0f55c4 100644 --- a/gdb/arch-utils.c +++ b/gdb/arch-utils.c @@ -37,6 +37,7 @@ #include "floatformat.h" +#include "dis-asm.h" struct displaced_step_closure * simple_displaced_step_copy_insn (struct gdbarch *gdbarch, @@ -973,6 +974,25 @@ default_guess_tracepoint_registers (struct gdbarch *gdbarch, regcache_raw_supply (regcache, pc_regno, regs); } +int +default_print_insn (bfd_vma memaddr, disassemble_info *info) +{ + disassembler_ftype disassemble_fn; + + if (exec_bfd != NULL) + { + gdb_assert (info->arch == bfd_get_arch (exec_bfd)); + gdb_assert (info->endian == (bfd_big_endian (exec_bfd) + ? BFD_ENDIAN_BIG : BFD_ENDIAN_LITTLE)); + gdb_assert (info->mach == bfd_get_mach (exec_bfd)); + } + disassemble_fn = disassembler (info->arch, info->endian == BFD_ENDIAN_BIG, + info->mach, exec_bfd); + + gdb_assert (disassemble_fn != NULL); + return (*disassemble_fn) (memaddr, info); +} + /* -Wmissing-prototypes */ extern initialize_file_ftype _initialize_gdbarch_utils; diff --git a/gdb/arch-utils.h b/gdb/arch-utils.h index 967a4b19de1..040afcaabd3 100644 --- a/gdb/arch-utils.h +++ b/gdb/arch-utils.h @@ -273,4 +273,6 @@ extern void default_guess_tracepoint_registers (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR addr); +extern int default_print_insn (bfd_vma memaddr, disassemble_info *info); + #endif diff --git a/gdb/avr-tdep.c b/gdb/avr-tdep.c index ec9db1cb3a7..3d041c619f5 100644 --- a/gdb/avr-tdep.c +++ b/gdb/avr-tdep.c @@ -1499,7 +1499,6 @@ avr_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_pseudo_register_write (gdbarch, avr_pseudo_register_write); set_gdbarch_return_value (gdbarch, avr_return_value); - set_gdbarch_print_insn (gdbarch, print_insn_avr); set_gdbarch_push_dummy_call (gdbarch, avr_push_dummy_call); diff --git a/gdb/bfin-tdep.c b/gdb/bfin-tdep.c index c590a9132c0..bfb5d57a4c3 100644 --- a/gdb/bfin-tdep.c +++ b/gdb/bfin-tdep.c @@ -838,7 +838,6 @@ bfin_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_frame_args_skip (gdbarch, 8); set_gdbarch_unwind_pc (gdbarch, bfin_unwind_pc); set_gdbarch_frame_align (gdbarch, bfin_frame_align); - set_gdbarch_print_insn (gdbarch, print_insn_bfin); /* Hook in ABI-specific overrides, if they have been registered. */ gdbarch_init_osabi (info, gdbarch); diff --git a/gdb/cris-tdep.c b/gdb/cris-tdep.c index eb397725a71..e554e241908 100644 --- a/gdb/cris-tdep.c +++ b/gdb/cris-tdep.c @@ -3785,19 +3785,6 @@ cris_gdb_func (struct gdbarch *gdbarch, enum cris_op_type op_type, } } -/* This wrapper is to avoid cris_get_assembler being called before - exec_bfd has been set. */ - -static int -cris_delayed_get_disassembler (bfd_vma addr, struct disassemble_info *info) -{ - int (*print_insn) (bfd_vma addr, struct disassemble_info *info); - - print_insn = cris_get_disassembler (exec_bfd); - gdb_assert (print_insn != NULL); - return print_insn (addr, info); -} - /* Originally from . */ typedef unsigned char cris_elf_greg_t[4]; @@ -4134,10 +4121,5 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* Hook in ABI-specific overrides, if they have been registered. */ gdbarch_init_osabi (info, gdbarch); - /* FIXME: cagney/2003-08-27: It should be possible to select a CRIS - disassembler, even when there is no BFD. Does something like - "gdb; target remote; disassmeble *0x123" work? */ - set_gdbarch_print_insn (gdbarch, cris_delayed_get_disassembler); - return gdbarch; } diff --git a/gdb/frv-tdep.c b/gdb/frv-tdep.c index 87447337a87..c0257bdb4cd 100644 --- a/gdb/frv-tdep.c +++ b/gdb/frv-tdep.c @@ -1582,7 +1582,6 @@ frv_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) break; } - set_gdbarch_print_insn (gdbarch, print_insn_frv); if (frv_abi (gdbarch) == FRV_ABI_FDPIC) set_gdbarch_convert_from_func_ptr_addr (gdbarch, frv_convert_from_func_ptr_addr); diff --git a/gdb/ft32-tdep.c b/gdb/ft32-tdep.c index 5b28275e5d8..966a593a34c 100644 --- a/gdb/ft32-tdep.c +++ b/gdb/ft32-tdep.c @@ -637,8 +637,6 @@ ft32_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_unwind_pc (gdbarch, ft32_unwind_pc); - set_gdbarch_print_insn (gdbarch, print_insn_ft32); - /* Hook in ABI-specific overrides, if they have been registered. */ gdbarch_init_osabi (info, gdbarch); diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c index 9c827ac6531..257c39fd1e7 100644 --- a/gdb/gdbarch.c +++ b/gdb/gdbarch.c @@ -429,6 +429,7 @@ gdbarch_alloc (const struct gdbarch_info *info, gdbarch->stabs_argument_has_addr = default_stabs_argument_has_addr; gdbarch->convert_from_func_ptr_addr = convert_from_func_ptr_addr_identity; gdbarch->addr_bits_remove = core_addr_identity; + gdbarch->print_insn = default_print_insn; gdbarch->skip_trampoline_code = generic_skip_trampoline_code; gdbarch->skip_solib_resolver = generic_skip_solib_resolver; gdbarch->in_solib_return_trampoline = generic_in_solib_return_trampoline; @@ -621,8 +622,7 @@ verify_gdbarch (struct gdbarch *gdbarch) /* Skip verify of addr_bits_remove, invalid_p == 0 */ /* Skip verify of software_single_step, has predicate. */ /* Skip verify of single_step_through_delay, has predicate. */ - if (gdbarch->print_insn == 0) - log.puts ("\n\tprint_insn"); + /* Skip verify of print_insn, invalid_p == 0 */ /* Skip verify of skip_trampoline_code, invalid_p == 0 */ /* Skip verify of skip_solib_resolver, invalid_p == 0 */ /* Skip verify of in_solib_return_trampoline, invalid_p == 0 */ diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh index 753819f321c..7992cbe355c 100755 --- a/gdb/gdbarch.sh +++ b/gdb/gdbarch.sh @@ -643,7 +643,7 @@ F;std::vector;software_single_step;struct regcache *regcache;regcache M;int;single_step_through_delay;struct frame_info *frame;frame # FIXME: cagney/2003-08-28: Need to find a better way of selecting the # disassembler. Perhaps objdump can handle it? -f;int;print_insn;bfd_vma vma, struct disassemble_info *info;vma, info;;0; +f;int;print_insn;bfd_vma vma, struct disassemble_info *info;vma, info;;default_print_insn;;0 f;CORE_ADDR;skip_trampoline_code;struct frame_info *frame, CORE_ADDR pc;frame, pc;;generic_skip_trampoline_code;;0 diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c index 2636a27bbbe..229b061b106 100644 --- a/gdb/hppa-tdep.c +++ b/gdb/hppa-tdep.c @@ -3122,8 +3122,6 @@ hppa_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* Helper for function argument information. */ set_gdbarch_fetch_pointer_argument (gdbarch, hppa_fetch_pointer_argument); - set_gdbarch_print_insn (gdbarch, print_insn_hppa); - /* When a hardware watchpoint triggers, we'll move the inferior past it by removing all eventpoints; stepping past the instruction that caused the trigger; reinserting eventpoints; and checking diff --git a/gdb/iq2000-tdep.c b/gdb/iq2000-tdep.c index 7d8ed3ca291..99824b7f8aa 100644 --- a/gdb/iq2000-tdep.c +++ b/gdb/iq2000-tdep.c @@ -838,7 +838,6 @@ iq2000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_frame_args_skip (gdbarch, 0); set_gdbarch_skip_prologue (gdbarch, iq2000_skip_prologue); set_gdbarch_inner_than (gdbarch, core_addr_lessthan); - set_gdbarch_print_insn (gdbarch, print_insn_iq2000); set_gdbarch_register_type (gdbarch, iq2000_register_type); set_gdbarch_frame_align (gdbarch, iq2000_frame_align); set_gdbarch_unwind_sp (gdbarch, iq2000_unwind_sp); diff --git a/gdb/lm32-tdep.c b/gdb/lm32-tdep.c index bd3e182a675..84ece3e93f0 100644 --- a/gdb/lm32-tdep.c +++ b/gdb/lm32-tdep.c @@ -565,9 +565,6 @@ lm32_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_push_dummy_call (gdbarch, lm32_push_dummy_call); set_gdbarch_return_value (gdbarch, lm32_return_value); - /* Instruction disassembler. */ - set_gdbarch_print_insn (gdbarch, print_insn_lm32); - lm32_add_reggroups (gdbarch); set_gdbarch_register_reggroup_p (gdbarch, lm32_register_reggroup_p); diff --git a/gdb/m32c-tdep.c b/gdb/m32c-tdep.c index 737637299f7..1bc5950c6e0 100644 --- a/gdb/m32c-tdep.c +++ b/gdb/m32c-tdep.c @@ -2639,9 +2639,6 @@ m32c_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* Register set. */ make_regs (gdbarch); - /* Disassembly. */ - set_gdbarch_print_insn (gdbarch, print_insn_m32c); - /* Breakpoints. */ set_gdbarch_breakpoint_kind_from_pc (gdbarch, m32c_breakpoint::kind_from_pc); set_gdbarch_sw_breakpoint_from_kind (gdbarch, m32c_breakpoint::bp_from_kind); diff --git a/gdb/m32r-tdep.c b/gdb/m32r-tdep.c index 0820af9d618..2d14cede7eb 100644 --- a/gdb/m32r-tdep.c +++ b/gdb/m32r-tdep.c @@ -947,8 +947,6 @@ m32r_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* Return the unwound PC value. */ set_gdbarch_unwind_pc (gdbarch, m32r_unwind_pc); - set_gdbarch_print_insn (gdbarch, print_insn_m32r); - /* Hook in ABI-specific overrides, if they have been registered. */ gdbarch_init_osabi (info, gdbarch); diff --git a/gdb/m68hc11-tdep.c b/gdb/m68hc11-tdep.c index 893d9c24798..b19ddf7b71d 100644 --- a/gdb/m68hc11-tdep.c +++ b/gdb/m68hc11-tdep.c @@ -1344,16 +1344,6 @@ m68hc11_elf_make_msymbol_special (asymbol *sym, struct minimal_symbol *msym) if (flags & STO_M68HC12_INTERRUPT) MSYMBOL_SET_RTI (msym); } - -static int -gdb_print_insn_m68hc11 (bfd_vma memaddr, disassemble_info *info) -{ - if (info->arch == bfd_arch_m68hc11) - return print_insn_m68hc11 (memaddr, info); - else - return print_insn_m68hc12 (memaddr, info); -} - /* 68HC11/68HC12 register groups. @@ -1525,7 +1515,6 @@ m68hc11_gdbarch_init (struct gdbarch_info info, m68hc11_breakpoint::kind_from_pc); set_gdbarch_sw_breakpoint_from_kind (gdbarch, m68hc11_breakpoint::bp_from_kind); - set_gdbarch_print_insn (gdbarch, gdb_print_insn_m68hc11); m68hc11_add_reggroups (gdbarch); set_gdbarch_register_reggroup_p (gdbarch, m68hc11_register_reggroup_p); diff --git a/gdb/m68k-tdep.c b/gdb/m68k-tdep.c index 7c3bf4cf157..5b4736da67e 100644 --- a/gdb/m68k-tdep.c +++ b/gdb/m68k-tdep.c @@ -1240,10 +1240,6 @@ m68k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_return_in_first_hidden_param_p (gdbarch, m68k_return_in_first_hidden_param_p); - - /* Disassembler. */ - set_gdbarch_print_insn (gdbarch, print_insn_m68k); - #if defined JB_PC && defined JB_ELEMENT_SIZE tdep->jb_pc = JB_PC; tdep->jb_elt_size = JB_ELEMENT_SIZE; diff --git a/gdb/m88k-tdep.c b/gdb/m88k-tdep.c index 57fe6449aeb..d08a9130c72 100644 --- a/gdb/m88k-tdep.c +++ b/gdb/m88k-tdep.c @@ -838,8 +838,6 @@ m88k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_iterate_over_regset_sections (gdbarch, m88k_iterate_over_regset_sections); - set_gdbarch_print_insn (gdbarch, print_insn_m88k); - set_gdbarch_skip_prologue (gdbarch, m88k_skip_prologue); /* Stack grows downward. */ diff --git a/gdb/microblaze-tdep.c b/gdb/microblaze-tdep.c index 59f94c554fd..86cb090c40f 100644 --- a/gdb/microblaze-tdep.c +++ b/gdb/microblaze-tdep.c @@ -738,8 +738,6 @@ microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_frame_args_skip (gdbarch, 8); - set_gdbarch_print_insn (gdbarch, print_insn_microblaze); - set_gdbarch_write_pc (gdbarch, microblaze_write_pc); set_gdbarch_unwind_pc (gdbarch, microblaze_unwind_pc); diff --git a/gdb/mn10300-tdep.c b/gdb/mn10300-tdep.c index 0f5e10fccc5..1e2526fa201 100644 --- a/gdb/mn10300-tdep.c +++ b/gdb/mn10300-tdep.c @@ -1444,8 +1444,6 @@ mn10300_gdbarch_init (struct gdbarch_info info, set_gdbarch_sw_breakpoint_from_kind (gdbarch, mn10300_breakpoint::bp_from_kind); /* decr_pc_after_break? */ - /* Disassembly. */ - set_gdbarch_print_insn (gdbarch, print_insn_mn10300); /* Stage 2 */ set_gdbarch_return_value (gdbarch, mn10300_return_value); diff --git a/gdb/moxie-tdep.c b/gdb/moxie-tdep.c index 2972d5248e2..91248cc75ca 100644 --- a/gdb/moxie-tdep.c +++ b/gdb/moxie-tdep.c @@ -1142,8 +1142,6 @@ moxie_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_unwind_pc (gdbarch, moxie_unwind_pc); - set_gdbarch_print_insn (gdbarch, print_insn_moxie); - /* Hook in ABI-specific overrides, if they have been registered. */ gdbarch_init_osabi (info, gdbarch); diff --git a/gdb/msp430-tdep.c b/gdb/msp430-tdep.c index d9eebf0cc26..d730e1bec45 100644 --- a/gdb/msp430-tdep.c +++ b/gdb/msp430-tdep.c @@ -997,9 +997,6 @@ msp430_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) msp430_breakpoint::bp_from_kind); set_gdbarch_decr_pc_after_break (gdbarch, 1); - /* Disassembly. */ - set_gdbarch_print_insn (gdbarch, print_insn_msp430); - /* Frames, prologues, etc. */ set_gdbarch_inner_than (gdbarch, core_addr_lessthan); set_gdbarch_skip_prologue (gdbarch, msp430_skip_prologue); diff --git a/gdb/mt-tdep.c b/gdb/mt-tdep.c index 1f94b017e79..2ab6c02c07d 100644 --- a/gdb/mt-tdep.c +++ b/gdb/mt-tdep.c @@ -1174,7 +1174,6 @@ mt_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_sw_breakpoint_from_kind (gdbarch, mt_sw_breakpoint_from_kind); set_gdbarch_decr_pc_after_break (gdbarch, 0); set_gdbarch_frame_args_skip (gdbarch, 0); - set_gdbarch_print_insn (gdbarch, print_insn_mt); set_gdbarch_register_type (gdbarch, mt_register_type); set_gdbarch_register_reggroup_p (gdbarch, mt_register_reggroup_p); diff --git a/gdb/nds32-tdep.c b/gdb/nds32-tdep.c index f942780c5d9..ae84567fdc2 100644 --- a/gdb/nds32-tdep.c +++ b/gdb/nds32-tdep.c @@ -2161,8 +2161,6 @@ nds32_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_frame_align (gdbarch, nds32_frame_align); frame_base_set_default (gdbarch, &nds32_frame_base); - set_gdbarch_print_insn (gdbarch, print_insn_nds32); - /* Handle longjmp. */ set_gdbarch_get_longjmp_target (gdbarch, nds32_get_longjmp_target); diff --git a/gdb/nios2-tdep.c b/gdb/nios2-tdep.c index c2140789210..905d8591b73 100644 --- a/gdb/nios2-tdep.c +++ b/gdb/nios2-tdep.c @@ -1772,18 +1772,6 @@ nios2_sw_breakpoint_from_kind (struct gdbarch *gdbarch, int kind, int *size) } } -/* Implement the print_insn gdbarch method. */ - -static int -nios2_print_insn (bfd_vma memaddr, disassemble_info *info) -{ - if (info->endian == BFD_ENDIAN_BIG) - return print_insn_big_nios2 (memaddr, info); - else - return print_insn_little_nios2 (memaddr, info); -} - - /* Implement the frame_align gdbarch method. */ static CORE_ADDR @@ -2357,8 +2345,6 @@ nios2_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) frame_base_set_default (gdbarch, &nios2_frame_base); - set_gdbarch_print_insn (gdbarch, nios2_print_insn); - /* Enable inferior call support. */ set_gdbarch_push_dummy_call (gdbarch, nios2_push_dummy_call); diff --git a/gdb/rx-tdep.c b/gdb/rx-tdep.c index 83bb3ec1317..cfd185644a0 100644 --- a/gdb/rx-tdep.c +++ b/gdb/rx-tdep.c @@ -1117,8 +1117,6 @@ rx_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_sw_breakpoint_from_kind (gdbarch, rx_breakpoint::bp_from_kind); set_gdbarch_skip_prologue (gdbarch, rx_skip_prologue); - set_gdbarch_print_insn (gdbarch, print_insn_rx); - set_gdbarch_unwind_pc (gdbarch, rx_unwind_pc); set_gdbarch_unwind_sp (gdbarch, rx_unwind_sp); diff --git a/gdb/s390-linux-tdep.c b/gdb/s390-linux-tdep.c index 8139d817d94..6d682608d41 100644 --- a/gdb/s390-linux-tdep.c +++ b/gdb/s390-linux-tdep.c @@ -8040,8 +8040,6 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) break; } - set_gdbarch_print_insn (gdbarch, print_insn_s390); - set_gdbarch_skip_trampoline_code (gdbarch, find_solib_trampoline_target); /* Enable TLS support. */ diff --git a/gdb/score-tdep.c b/gdb/score-tdep.c index 94cf0caf6e4..d231674196c 100644 --- a/gdb/score-tdep.c +++ b/gdb/score-tdep.c @@ -126,15 +126,6 @@ score_register_sim_regno (struct gdbarch *gdbarch, int regnum) } #endif -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); -} - static inst_t * score7_fetch_inst (struct gdbarch *gdbarch, CORE_ADDR addr, gdb_byte *memblock) { @@ -1491,7 +1482,6 @@ score_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_inner_than (gdbarch, core_addr_lessthan); set_gdbarch_unwind_sp (gdbarch, score_unwind_sp); set_gdbarch_unwind_pc (gdbarch, score_unwind_pc); - set_gdbarch_print_insn (gdbarch, score_print_insn); switch (target_mach) { diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c index 0bc678a286b..2c2b26847d5 100644 --- a/gdb/sh-tdep.c +++ b/gdb/sh-tdep.c @@ -2289,7 +2289,6 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_breakpoint_kind_from_pc (gdbarch, sh_breakpoint_kind_from_pc); set_gdbarch_sw_breakpoint_from_kind (gdbarch, sh_sw_breakpoint_from_kind); - set_gdbarch_print_insn (gdbarch, print_insn_sh); set_gdbarch_register_sim_regno (gdbarch, legacy_register_sim_regno); set_gdbarch_return_value (gdbarch, sh_return_value_nofpu); diff --git a/gdb/sh64-tdep.c b/gdb/sh64-tdep.c index 33986fd12ff..581b57fd9f0 100644 --- a/gdb/sh64-tdep.c +++ b/gdb/sh64-tdep.c @@ -2416,8 +2416,6 @@ sh64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_breakpoint_kind_from_pc (gdbarch, sh64_breakpoint_kind_from_pc); set_gdbarch_sw_breakpoint_from_kind (gdbarch, sh64_sw_breakpoint_from_kind); - - set_gdbarch_print_insn (gdbarch, print_insn_sh); set_gdbarch_register_sim_regno (gdbarch, legacy_register_sim_regno); set_gdbarch_return_value (gdbarch, sh64_return_value); diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c index fa0e04e39d0..dce85275ac4 100644 --- a/gdb/sparc-tdep.c +++ b/gdb/sparc-tdep.c @@ -1855,8 +1855,6 @@ sparc32_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_frame_args_skip (gdbarch, 8); - set_gdbarch_print_insn (gdbarch, print_insn_sparc); - set_gdbarch_software_single_step (gdbarch, sparc_software_single_step); set_gdbarch_write_pc (gdbarch, sparc_write_pc); diff --git a/gdb/tic6x-tdep.c b/gdb/tic6x-tdep.c index 012b749389d..156a54f3afc 100644 --- a/gdb/tic6x-tdep.c +++ b/gdb/tic6x-tdep.c @@ -346,14 +346,6 @@ tic6x_sw_breakpoint_from_kind (struct gdbarch *gdbarch, int kind, int *size) return tdep->breakpoint; } -/* This is the implementation of gdbarch method print_insn. */ - -static int -tic6x_print_insn (bfd_vma memaddr, disassemble_info *info) -{ - return print_insn_tic6x (memaddr, info); -} - static void tic6x_dwarf2_frame_init_reg (struct gdbarch *gdbarch, int regnum, struct dwarf2_frame_state_reg *reg, @@ -1318,8 +1310,6 @@ tic6x_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* Single stepping. */ set_gdbarch_software_single_step (gdbarch, tic6x_software_single_step); - set_gdbarch_print_insn (gdbarch, tic6x_print_insn); - /* Call dummy code. */ set_gdbarch_frame_align (gdbarch, tic6x_frame_align); diff --git a/gdb/tilegx-tdep.c b/gdb/tilegx-tdep.c index fd42a350473..2db679066b1 100644 --- a/gdb/tilegx-tdep.c +++ b/gdb/tilegx-tdep.c @@ -1055,8 +1055,6 @@ tilegx_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) tilegx_breakpoint::bp_from_kind); set_gdbarch_return_value (gdbarch, tilegx_return_value); - set_gdbarch_print_insn (gdbarch, print_insn_tilegx); - gdbarch_init_osabi (info, gdbarch); dwarf2_append_unwinders (gdbarch); diff --git a/gdb/v850-tdep.c b/gdb/v850-tdep.c index 668635e50c7..087026af69d 100644 --- a/gdb/v850-tdep.c +++ b/gdb/v850-tdep.c @@ -1463,8 +1463,6 @@ v850_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_push_dummy_call (gdbarch, v850_push_dummy_call); set_gdbarch_skip_prologue (gdbarch, v850_skip_prologue); - set_gdbarch_print_insn (gdbarch, print_insn_v850); - set_gdbarch_frame_align (gdbarch, v850_frame_align); set_gdbarch_unwind_sp (gdbarch, v850_unwind_sp); set_gdbarch_unwind_pc (gdbarch, v850_unwind_pc); diff --git a/gdb/vax-tdep.c b/gdb/vax-tdep.c index 870d26800df..a92a35aaa33 100644 --- a/gdb/vax-tdep.c +++ b/gdb/vax-tdep.c @@ -502,8 +502,6 @@ vax_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_deprecated_function_start_offset (gdbarch, 2); set_gdbarch_believe_pcc_promotion (gdbarch, 1); - set_gdbarch_print_insn (gdbarch, print_insn_vax); - set_gdbarch_unwind_pc (gdbarch, vax_unwind_pc); frame_base_set_default (gdbarch, &vax_frame_base); diff --git a/gdb/xstormy16-tdep.c b/gdb/xstormy16-tdep.c index 7fdfc6517a6..9d91fd540f8 100644 --- a/gdb/xstormy16-tdep.c +++ b/gdb/xstormy16-tdep.c @@ -849,8 +849,6 @@ xstormy16_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_skip_trampoline_code (gdbarch, xstormy16_skip_trampoline_code); - set_gdbarch_print_insn (gdbarch, print_insn_xstormy16); - gdbarch_init_osabi (info, gdbarch); dwarf2_append_unwinders (gdbarch); diff --git a/gdb/xtensa-tdep.c b/gdb/xtensa-tdep.c index 0a4ed37cf95..f9e858473a4 100644 --- a/gdb/xtensa-tdep.c +++ b/gdb/xtensa-tdep.c @@ -3256,8 +3256,6 @@ xtensa_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) frame_unwind_append_unwinder (gdbarch, &xtensa_unwind); dwarf2_append_unwinders (gdbarch); - set_gdbarch_print_insn (gdbarch, print_insn_xtensa); - set_gdbarch_have_nonsteppable_watchpoint (gdbarch, 1); xtensa_add_reggroups (gdbarch); -- 2.30.2