diff options
author | Yao Qi <yao.qi@linaro.org> | 2017-05-24 17:23:52 +0100 |
---|---|---|
committer | Yao Qi <yao.qi@linaro.org> | 2017-05-24 17:23:52 +0100 |
commit | 39503f82427e22ed8e04d986ccdc8562091ec62e (patch) | |
tree | b25888e68551d99e1a96e7913018d51a0affa678 /gdb/m68hc11-tdep.c | |
parent | 003ca0fd22863aaf1a9811c8a35a0133a2d27fb1 (diff) | |
download | gdb-39503f82427e22ed8e04d986ccdc8562091ec62e.zip gdb-39503f82427e22ed8e04d986ccdc8562091ec62e.tar.gz gdb-39503f82427e22ed8e04d986ccdc8562091ec62e.tar.bz2 |
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.
Diffstat (limited to 'gdb/m68hc11-tdep.c')
-rw-r--r-- | gdb/m68hc11-tdep.c | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/gdb/m68hc11-tdep.c b/gdb/m68hc11-tdep.c index 893d9c2..b19ddf7b 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); |