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 | f4985dba0f53b38efcca4eef42cfbfca5ef44ee2 (patch) | |
tree | 65bb4cbe56e54fdb29a914b828a1594fe341e941 | |
parent | ab20fa4ae95212c58e369916de347f3d518530c2 (diff) | |
download | gdb-f4985dba0f53b38efcca4eef42cfbfca5ef44ee2.zip gdb-f4985dba0f53b38efcca4eef42cfbfca5ef44ee2.tar.gz gdb-f4985dba0f53b38efcca4eef42cfbfca5ef44ee2.tar.bz2 |
Use disassemble.c:disassembler select rs6000 disassembler
Nowadays, rs6000 disassembler is selected in different ways in
opcodes and gdb,
opcodes:
case bfd_arch_rs6000:
if (mach == bfd_mach_ppc_620)
disassemble = print_insn_big_powerpc;
else
disassemble = print_insn_rs6000;
break;
gdb:
if (arch == bfd_arch_rs6000)
set_gdbarch_print_insn (gdbarch, print_insn_rs6000);
else
set_gdbarch_print_insn (gdbarch, gdb_print_insn_powerpc);
I am not sure which one is the right one. However, such selection
should be done in one place instead of two.
gdb:
2017-05-24 Yao Qi <yao.qi@linaro.org>
* rs6000-tdep.c (gdb_print_insn_powerpc): Remove.
(rs6000_gdbarch_init): Don't call set_gdbarch_print_insn.
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/rs6000-tdep.c | 14 |
2 files changed, 5 insertions, 14 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 4e329af..a96e71f 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2017-05-24 Yao Qi <yao.qi@linaro.org> + * rs6000-tdep.c (gdb_print_insn_powerpc): Remove. + (rs6000_gdbarch_init): Don't call set_gdbarch_print_insn. + +2017-05-24 Yao Qi <yao.qi@linaro.org> + * rl78-tdep.c (rl78_gdbarch_init): Don't call set_gdbarch_print_insn. diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c index 204b34a..57faa67 100644 --- a/gdb/rs6000-tdep.c +++ b/gdb/rs6000-tdep.c @@ -3233,14 +3233,6 @@ find_variant_by_arch (enum bfd_architecture arch, unsigned long mach) return NULL; } -static int -gdb_print_insn_powerpc (bfd_vma memaddr, disassemble_info *info) -{ - if (info->endian == BFD_ENDIAN_BIG) - return print_insn_big_powerpc (memaddr, info); - else - return print_insn_little_powerpc (memaddr, info); -} static CORE_ADDR rs6000_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame) @@ -6449,12 +6441,6 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_have_nonsteppable_watchpoint (gdbarch, 1); - /* Select instruction printer. */ - if (arch == bfd_arch_rs6000) - set_gdbarch_print_insn (gdbarch, print_insn_rs6000); - else - set_gdbarch_print_insn (gdbarch, gdb_print_insn_powerpc); - set_gdbarch_num_regs (gdbarch, PPC_NUM_REGS); if (have_spe) |