[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 002/118] monitor: QEMU Monitor Instruction Disassembl
From: |
Alexander Graf |
Subject: |
[Qemu-devel] [PULL 002/118] monitor: QEMU Monitor Instruction Disassembly Incorrect for PowerPC LE Mode |
Date: |
Wed, 4 Jun 2014 14:43:03 +0200 |
From: Tom Musta <address@hidden>
The monitor support for disassembling instructions does not honor the MSR[LE]
bit for PowerPC processors.
This change enhances the monitor_disas() routine by supporting a flag bit
for Little Endian mode. Bit 16 is used since that bit was used in the
analagous guest disassembly routine target_disas().
Also, to be consistent with target_disas(), the disassembler bfd_mach field
can be passed in the flags argument.
Reported-by: Anton Blanchard <address@hidden>
Signed-off-by: Tom Musta <address@hidden>
Reviewed-by: Peter Maydell <address@hidden>
Signed-off-by: Alexander Graf <address@hidden>
---
disas.c | 14 ++++++++++++--
monitor.c | 4 ++++
2 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/disas.c b/disas.c
index 1397167..44a019a 100644
--- a/disas.c
+++ b/disas.c
@@ -445,6 +445,8 @@ monitor_fprintf(FILE *stream, const char *fmt, ...)
return 0;
}
+/* Disassembler for the monitor.
+ See target_disas for a description of flags. */
void monitor_disas(Monitor *mon, CPUArchState *env,
target_ulong pc, int nb_insn, int is_physical, int flags)
{
@@ -485,11 +487,19 @@ void monitor_disas(Monitor *mon, CPUArchState *env,
s.info.mach = bfd_mach_sparc_v9b;
#endif
#elif defined(TARGET_PPC)
+ if (flags & 0xFFFF) {
+ /* If we have a precise definition of the instruction set, use it. */
+ s.info.mach = flags & 0xFFFF;
+ } else {
#ifdef TARGET_PPC64
- s.info.mach = bfd_mach_ppc64;
+ s.info.mach = bfd_mach_ppc64;
#else
- s.info.mach = bfd_mach_ppc;
+ s.info.mach = bfd_mach_ppc;
#endif
+ }
+ if ((flags >> 16) & 1) {
+ s.info.endian = BFD_ENDIAN_LITTLE;
+ }
print_insn = print_insn_ppc;
#elif defined(TARGET_M68K)
print_insn = print_insn_m68k;
diff --git a/monitor.c b/monitor.c
index 593679a..a7a0f85 100644
--- a/monitor.c
+++ b/monitor.c
@@ -1283,6 +1283,10 @@ static void memory_dump(Monitor *mon, int count, int
format, int wsize,
}
}
#endif
+#ifdef TARGET_PPC
+ flags = msr_le << 16;
+ flags |= env->bfd_mach;
+#endif
monitor_disas(mon, env, addr, count, is_physical, flags);
return;
}
--
1.8.1.4
- [Qemu-devel] [PULL 00/118] ppc patch queue 2014-06-04, Alexander Graf, 2014/06/04
- [Qemu-devel] [PULL 003/118] Fix typo in eTSEC Ethernet controller, Alexander Graf, 2014/06/04
- [Qemu-devel] [PULL 008/118] target-ppc: Move alias lookup after class lookup, Alexander Graf, 2014/06/04
- [Qemu-devel] [PULL 001/118] target-ppc: Fix target_disas, Alexander Graf, 2014/06/04
- [Qemu-devel] [PULL 002/118] monitor: QEMU Monitor Instruction Disassembly Incorrect for PowerPC LE Mode,
Alexander Graf <=
- [Qemu-devel] [PULL 005/118] target-ppc: extract register length calculation in gdbstub, Alexander Graf, 2014/06/04
- [Qemu-devel] [PULL 009/118] target-ppc: Remove redundant POWER7 declarations, Alexander Graf, 2014/06/04
- [Qemu-devel] [PULL 010/118] spapr-pci: remove io ports workaround, Alexander Graf, 2014/06/04
- [Qemu-devel] [PULL 014/118] mac99: Added FW_CFG_PPC_BUSFREQ to match CLOCKFREQ and TBFREQ already there, Alexander Graf, 2014/06/04
- [Qemu-devel] [PULL 004/118] spapr_nvram: Correct max nvram size, Alexander Graf, 2014/06/04
- [Qemu-devel] [PULL 011/118] spapr_pci: Fix number of returned vectors in ibm, change-msi, Alexander Graf, 2014/06/04
- [Qemu-devel] [PULL 007/118] target-ppc: Create versionless CPU class per family if KVM, Alexander Graf, 2014/06/04
- [Qemu-devel] [PULL 006/118] target-ppc: gdbstub allow byte swapping for reading/writing registers, Alexander Graf, 2014/06/04
- [Qemu-devel] [PULL 013/118] target-ppc: Remove PVR check from migration, Alexander Graf, 2014/06/04
- [Qemu-devel] [PULL 021/118] libdecnumber: Eliminate Unused Variable in decSetSubnormal, Alexander Graf, 2014/06/04