From: Pekka Enberg Date: Thu, 8 Apr 2010 18:53:07 +0000 (+0300) Subject: kvm: Dump stack on KVM oops X-Git-Tag: next-20110824~3^2~528^2~178 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=7dc9fe1eb5a7b70730f6a87a43206fc8b6549a3e;p=karo-tx-linux.git kvm: Dump stack on KVM oops Signed-off-by: Pekka Enberg --- diff --git a/tools/kvm/kvm.c b/tools/kvm/kvm.c index 4cc3756777b7..1ecf79d86a65 100644 --- a/tools/kvm/kvm.c +++ b/tools/kvm/kvm.c @@ -654,6 +654,9 @@ void kvm__show_code(struct kvm *self) } printf("\n"); + + printf("Stack:\n"); + kvm__dump_mem(self, self->regs.rsp, 32); } void kvm__dump_mem(struct kvm *self, unsigned long addr, unsigned long size) @@ -665,12 +668,10 @@ void kvm__dump_mem(struct kvm *self, unsigned long addr, unsigned long size) if (!size) return; - p = (unsigned char *)guest_flat_to_host(self, addr); - - printf("Guest memory dump:\n"); + p = guest_flat_to_host(self, addr); for (n = 0; n < size; n+=8) - printf("0x%08lx: %02x%02x%02x%02x %02x%02x%02x%02x\n", + printf(" 0x%08lx: %02x %02x %02x %02x %02x %02x %02x %02x\n", addr + n, p[n + 0], p[n + 1], p[n + 2], p[n + 3], p[n + 4], p[n + 5], p[n + 6], p[n + 7]); }