diff options
author | Giacomo Travaglini <giacomo.travaglini@arm.com> | 2019-02-13 15:14:34 +0000 |
---|---|---|
committer | Giacomo Travaglini <giacomo.travaglini@arm.com> | 2019-04-29 08:49:25 +0000 |
commit | 529284becb4610016bdea7a5a40d1be73e2ec697 (patch) | |
tree | cf44884be90c9fde6409bed9aa50a492011889b9 /src/arch/arm/faults.cc | |
parent | 9305bb6e83d57fde96c78e7b11d50914935f57d5 (diff) | |
download | gem5-529284becb4610016bdea7a5a40d1be73e2ec697.tar.xz |
arch-arm: Report real instruction encoding when Undefined
When dumping the opcode that caused an Undefined Instruction, we just
want to dump the real instruction encoding, and not the extended version
with metabits (like thumb, bigThumb etc). This was not appening when
panicking in SE mode.
The patch is also replacing custom masking in the Unknown(64) disassembler
in favour of ArmStaticInstruction::encoding() helper.
Change-Id: I9eb6fd145d02b4b07bb51f0bd89ca014d6d5a6de
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18395
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Diffstat (limited to 'src/arch/arm/faults.cc')
-rw-r--r-- | src/arch/arm/faults.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/arch/arm/faults.cc b/src/arch/arm/faults.cc index 665b2989c..9cd068f7f 100644 --- a/src/arch/arm/faults.cc +++ b/src/arch/arm/faults.cc @@ -749,15 +749,16 @@ UndefinedInstruction::invoke(ThreadContext *tc, const StaticInstPtr &inst) // If the mnemonic isn't defined this has to be an unknown instruction. assert(unknown || mnemonic != NULL); + auto arm_inst = static_cast<ArmStaticInst *>(inst.get()); if (disabled) { panic("Attempted to execute disabled instruction " - "'%s' (inst 0x%08x)", mnemonic, machInst); + "'%s' (inst 0x%08x)", mnemonic, arm_inst->encoding()); } else if (unknown) { panic("Attempted to execute unknown instruction (inst 0x%08x)", - machInst); + arm_inst->encoding()); } else { panic("Attempted to execute unimplemented instruction " - "'%s' (inst 0x%08x)", mnemonic, machInst); + "'%s' (inst 0x%08x)", mnemonic, arm_inst->encoding()); } } |