[kvm-unit-tests PATCH] x86: Print error code for unhandled exceptions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Print the error code for unhandled exceptions too, to ease debugging.

Also use the symbolic name for the #PF vector.

Signed-off-by: Mathias Krause <minipli@xxxxxxxxxxxxxx>
---
 lib/x86/desc.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/x86/desc.c b/lib/x86/desc.c
index fca37b9a5cee..f4cdfbc92c56 100644
--- a/lib/x86/desc.c
+++ b/lib/x86/desc.c
@@ -141,10 +141,10 @@ const char* exception_mnemonic(int vector)
 
 void unhandled_exception(struct ex_regs *regs, bool cpu)
 {
-	printf("Unhandled %sexception %ld %s at ip %016lx\n",
+	printf("Unhandled %sexception %ld %s(%lx) at ip %016lx\n",
 	       cpu ? "cpu " : "", regs->vector,
-	       exception_mnemonic(regs->vector), regs->rip);
-	if (regs->vector == 14)
+	       exception_mnemonic(regs->vector), regs->error_code, regs->rip);
+	if (regs->vector == PF_VECTOR)
 		printf("PF at %#lx addr %#lx\n", regs->rip, read_cr2());
 
 	printf("error_code=%04lx      rflags=%08lx      cs=%08lx\n"
-- 
2.30.2





[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux