aboutsummaryrefslogtreecommitdiff
path: root/opcodes/rl78-dis.c
diff options
context:
space:
mode:
authorYao Qi <yao.qi@linaro.org>2017-05-24 17:23:52 +0100
committerYao Qi <yao.qi@linaro.org>2017-05-24 17:23:52 +0100
commitab20fa4ae95212c58e369916de347f3d518530c2 (patch)
treeca84c9f4cb6abca5da0660cef18234840bf88432 /opcodes/rl78-dis.c
parentf532ab94387d1bc47de619ae08ead522753d89fa (diff)
downloadgdb-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.
Diffstat (limited to 'opcodes/rl78-dis.c')
-rw-r--r--opcodes/rl78-dis.c6
1 files changed, 5 insertions, 1 deletions
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: