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 | 003ca0fd22863aaf1a9811c8a35a0133a2d27fb1 (patch) | |
tree | e988f36b10ca84252d27167db6d8d32e81f1c831 /sim | |
parent | Automatic date update in version.in (diff) | |
download | binutils-gdb-003ca0fd22863aaf1a9811c8a35a0133a2d27fb1.tar.gz binutils-gdb-003ca0fd22863aaf1a9811c8a35a0133a2d27fb1.tar.bz2 binutils-gdb-003ca0fd22863aaf1a9811c8a35a0133a2d27fb1.zip |
Refactor disassembler selection
Nowadays, opcodes/disassemble.c:disassembler selects the proper
disassembler according to ABFD only. However, it actually
selects disassemblers according to arch, mach, endianess, and
abfd. This patch adds them to the parameters of disassembler,
so that its caller can still select disassemblers in case that
abfd is NULL (a typical case in GDB).
There isn't any functionality change.
binutils:
2017-05-24 Yao Qi <yao.qi@linaro.org>
* objdump.c (disassemble_data): Caller update.
include:
2017-05-24 Yao Qi <yao.qi@linaro.org>
* dis-asm.h (disassembler): Update declaration.
opcodes:
2017-05-24 Yao Qi <yao.qi@linaro.org>
* disassemble.c (disassembler): Add arguments a, big and mach.
Use them.
sim/common:
2017-05-24 Yao Qi <yao.qi@linaro.org>
* sim-trace.c (trace_disasm): Caller update.
Diffstat (limited to 'sim')
-rw-r--r-- | sim/common/ChangeLog | 4 | ||||
-rw-r--r-- | sim/common/sim-trace.c | 6 |
2 files changed, 9 insertions, 1 deletions
diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog index 0d4ec46a3e3..65c2f8bdce6 100644 --- a/sim/common/ChangeLog +++ b/sim/common/ChangeLog @@ -1,3 +1,7 @@ +2017-05-24 Yao Qi <yao.qi@linaro.org> + + * sim-trace.c (trace_disasm): Caller update. + 2016-08-15 Mike Frysinger <vapier@gentoo.org> * sim-base.h (sim_state_base): Add prog_syms_count. diff --git a/sim/common/sim-trace.c b/sim/common/sim-trace.c index da19b829d5b..ff11d20f0e9 100644 --- a/sim/common/sim-trace.c +++ b/sim/common/sim-trace.c @@ -919,7 +919,11 @@ trace_disasm (SIM_DESC sd, sim_cpu *cpu, address_word addr) if (trace_data->dis_bfd != bfd) { trace_data->dis_bfd = bfd; - trace_data->disassembler = disassembler (trace_data->dis_bfd); + trace_data->disassembler + = disassembler (bfd_get_arch (trace_data->dis_bfd), + bfd_big_endian (trace_data->dis_bfd), + bfd_get_mach (trace_data->dis_bfd), + trace_data->dis_bfd); INIT_DISASSEMBLE_INFO (*info, cpu, dis_printf); info->read_memory_func = dis_read; info->arch = bfd_get_arch (bfd); |