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 | ab20fa4ae95212c58e369916de347f3d518530c2 (patch) | |
tree | ca84c9f4cb6abca5da0660cef18234840bf88432 | |
parent | f532ab94387d1bc47de619ae08ead522753d89fa (diff) | |
download | gdb-ab20fa4ae95212c58e369916de347f3d518530c2.zip gdb-ab20fa4ae95212c58e369916de347f3d518530c2.tar.gz gdb-ab20fa4ae95212c58e369916de347f3d518530c2.tar.bz2 |
Use disassemble.c:disassembler select rl78 disassembler
This patch changes rl78 to let disassble.c:disassembler select
disassembler. rl78_get_disassembler doesn't handle the case
that abfd is NULL, so this patch also fix it.
gdb:
2017-05-24 Yao Qi <yao.qi@linaro.org>
* rl78-tdep.c (rl78_gdbarch_init): Don't call
set_gdbarch_print_insn.
opcodes:
2017-05-24 Yao Qi <yao.qi@linaro.org>
* rl78-dis.c (rl78_get_disassembler): If parameter abfd
is NULL, set cpu to E_FLAG_RL78_ANY_CPU.
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/rl78-tdep.c | 3 | ||||
-rw-r--r-- | opcodes/ChangeLog | 5 | ||||
-rw-r--r-- | opcodes/rl78-dis.c | 6 |
4 files changed, 15 insertions, 4 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index f3b88e1..4e329af 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2017-05-24 Yao Qi <yao.qi@linaro.org> + * rl78-tdep.c (rl78_gdbarch_init): Don't call + set_gdbarch_print_insn. + +2017-05-24 Yao Qi <yao.qi@linaro.org> + * h8300-tdep.c (h8300_gdbarch_init): Don't call set_gdbarch_print_insn. diff --git a/gdb/rl78-tdep.c b/gdb/rl78-tdep.c index 307a760..5775f96 100644 --- a/gdb/rl78-tdep.c +++ b/gdb/rl78-tdep.c @@ -1470,9 +1470,6 @@ rl78_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_sw_breakpoint_from_kind (gdbarch, rl78_breakpoint::bp_from_kind); set_gdbarch_decr_pc_after_break (gdbarch, 1); - /* Disassembly. */ - set_gdbarch_print_insn (gdbarch, print_insn_rl78); - /* Frames, prologues, etc. */ set_gdbarch_inner_than (gdbarch, core_addr_lessthan); set_gdbarch_skip_prologue (gdbarch, rl78_skip_prologue); diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index b461d78..912567b 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,5 +1,10 @@ 2017-05-24 Yao Qi <yao.qi@linaro.org> + * rl78-dis.c (rl78_get_disassembler): If parameter abfd + is NULL, set cpu to E_FLAG_RL78_ANY_CPU. + +2017-05-24 Yao Qi <yao.qi@linaro.org> + * disassemble.c (disassembler): Add arguments a, big and mach. Use them. diff --git a/opcodes/rl78-dis.c b/opcodes/rl78-dis.c index 1839436..799cd38 100644 --- a/opcodes/rl78-dis.c +++ b/opcodes/rl78-dis.c @@ -406,7 +406,11 @@ print_insn_rl78_g14 (bfd_vma addr, disassemble_info * dis) disassembler_ftype rl78_get_disassembler (bfd *abfd) { - int cpu = abfd->tdata.elf_obj_data->elf_header->e_flags & E_FLAG_RL78_CPU_MASK; + int cpu = E_FLAG_RL78_ANY_CPU; + + if (abfd != NULL) + cpu = abfd->tdata.elf_obj_data->elf_header->e_flags & E_FLAG_RL78_CPU_MASK; + switch (cpu) { case E_FLAG_RL78_G10: |