summaryrefslogtreecommitdiffstats
path: root/disas.c
diff options
context:
space:
mode:
authorClaudio Fontana <claudio.fontana@linaro.org>2014-02-05 17:27:28 +0000
committerPeter Maydell <peter.maydell@linaro.org>2014-02-08 14:50:48 +0000
commit999b53ec8794f203964db3ecf939a3da5c4bc843 (patch)
treeb9b9a8cffdc54b2d6a6f4386396e557642b21170 /disas.c
parent37fd5b53ba688e2a32d3966870361e667381ca95 (diff)
downloadhqemu-999b53ec8794f203964db3ecf939a3da5c4bc843.zip
hqemu-999b53ec8794f203964db3ecf939a3da5c4bc843.tar.gz
disas: Implement disassembly output for A64
Use libvixl to implement disassembly output in debug logs for A64, for use with both AArch64 hosts and targets. Signed-off-by: Claudio Fontana <claudio.fontana@linaro.org> [PMM: * added support for target disassembly * switched to custom QEMUDisassembler so the output format matches what QEMU expects * make sure we correctly fall back to "just print hex" if we didn't build the AArch64 disassembler because of lack of a C++ compiler * rename from 'aarch64' to 'arm-a64' because this is a disassembler for the A64 instruction set * merge aarch64.c and aarch64-cxx.cc into one C++ file * simplify the aarch64.c<->aarch64-cxx.cc interface] Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'disas.c')
-rw-r--r--disas.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/disas.c b/disas.c
index 0203ef2..79e6944 100644
--- a/disas.c
+++ b/disas.c
@@ -190,7 +190,7 @@ static int print_insn_od_target(bfd_vma pc, disassemble_info *info)
/* Disassemble this for me please... (debugging). 'flags' has the following
values:
i386 - 1 means 16 bit code, 2 means 64 bit code
- arm - bit 0 = thumb, bit 1 = reverse endian
+ arm - bit 0 = thumb, bit 1 = reverse endian, bit 2 = A64
ppc - nonzero means little endian
other targets - unused
*/
@@ -225,7 +225,15 @@ void target_disas(FILE *out, CPUArchState *env, target_ulong code,
}
print_insn = print_insn_i386;
#elif defined(TARGET_ARM)
- if (flags & 1) {
+ if (flags & 4) {
+ /* We might not be compiled with the A64 disassembler
+ * because it needs a C++ compiler; in that case we will
+ * fall through to the default print_insn_od case.
+ */
+#if defined(CONFIG_ARM_A64_DIS)
+ print_insn = print_insn_arm_a64;
+#endif
+ } else if (flags & 1) {
print_insn = print_insn_thumb1;
} else {
print_insn = print_insn_arm;
@@ -356,6 +364,8 @@ void disas(FILE *out, void *code, unsigned long size)
#elif defined(_ARCH_PPC)
s.info.disassembler_options = (char *)"any";
print_insn = print_insn_ppc;
+#elif defined(__aarch64__) && defined(CONFIG_ARM_A64_DIS)
+ print_insn = print_insn_arm_a64;
#elif defined(__alpha__)
print_insn = print_insn_alpha;
#elif defined(__sparc__)
OpenPOWER on IntegriCloud