Use disassemble.c:disassembler select rs6000 disassembler
authorYao Qi <yao.qi@linaro.org>
Wed, 24 May 2017 16:23:52 +0000 (17:23 +0100)
committerYao Qi <yao.qi@linaro.org>
Wed, 24 May 2017 16:23:52 +0000 (17:23 +0100)
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.

gdb/ChangeLog
gdb/rs6000-tdep.c

index 4e329af3f41852d0923edc0af508aac462950e0e..a96e71f69da610a26aa919c969a29bac970df7a0 100644 (file)
@@ -1,3 +1,8 @@
+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
index 204b34ab4e13ff4eef4f2c1b9db120787d7b4a13..57faa673b89aab7071128113d1105084fe3d7cc2 100644 (file)
@@ -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);
-}
 \f
 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)
This page took 0.029972 seconds and 4 git commands to generate.