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.
+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_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);
+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.
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: