From b620f98d34eac9fd1daad5b4da3c09aab2c9d3a1 Mon Sep 17 00:00:00 2001 From: Christopher Pelloux Date: Wed, 21 Feb 2024 19:07:03 -0500 Subject: [PATCH] Add more disassembly info during triple faults --- vmm/src/hve/arch/intel_x64/vcpu.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/vmm/src/hve/arch/intel_x64/vcpu.cpp b/vmm/src/hve/arch/intel_x64/vcpu.cpp index d7c0e4c43..5de90142c 100644 --- a/vmm/src/hve/arch/intel_x64/vcpu.cpp +++ b/vmm/src/hve/arch/intel_x64/vcpu.cpp @@ -303,7 +303,14 @@ bool vcpu::debug_triple_fault(::bfvmm::intel_x64::vcpu *vcpu) auto mode = vcpu_cast(vcpu)->insn_mode(); auto insn = disasm()->disasm_single(map.get(), rip, len, mode); - printv("%s: %s %s\n", __func__, insn->mnemonic, insn->op_str); + printv("%s: ", __func__); + printf("%2"PRIx64" ", insn.address); + for (int i = 0; i < insn.size; i++) { + if (i > 0) + putchar(' '); + printf("%02x", insn.bytes[i]); + } + printf(" %s %s\n", insn->mnemonic, insn->op_str); vcpu->halt("debugging triple fault");