aboutsummaryrefslogtreecommitdiffstats
path: root/tools/xentrace
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2009-02-06 10:43:58 +0000
committerKeir Fraser <keir.fraser@citrix.com>2009-02-06 10:43:58 +0000
commit2b9a5bea1586b81910cb2b79d525c5778a931536 (patch)
treeb6643143d8896df28494977a82385d7af953af66 /tools/xentrace
parent81e91a22e4a27a90a2b8e050ac386b47cf38eb63 (diff)
downloadxen-2b9a5bea1586b81910cb2b79d525c5778a931536.tar.gz
xen-2b9a5bea1586b81910cb2b79d525c5778a931536.tar.bz2
xen-2b9a5bea1586b81910cb2b79d525c5778a931536.zip
xenctx: print x86_32 context on x86_64
Although x86_64 context covers x86_32, I think it's easy to watch. Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
Diffstat (limited to 'tools/xentrace')
-rw-r--r--tools/xentrace/xenctx.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/tools/xentrace/xenctx.c b/tools/xentrace/xenctx.c
index 00410ef61c..d5ec038d9f 100644
--- a/tools/xentrace/xenctx.c
+++ b/tools/xentrace/xenctx.c
@@ -288,6 +288,35 @@ static void print_ctx_32(vcpu_guest_context_x86_32_t *ctx)
}
}
+static void print_ctx_32on64(vcpu_guest_context_x86_64_t *ctx)
+{
+ struct cpu_user_regs_x86_64 *regs = &ctx->user_regs;
+
+ printf("cs:eip: %04x:%08x ", regs->cs, (uint32_t)regs->eip);
+ print_symbol((uint32_t)regs->eip);
+ print_flags((uint32_t)regs->eflags);
+ printf("ss:esp: %04x:%08x\n", regs->ss, (uint32_t)regs->esp);
+
+ printf("eax: %08x\t", (uint32_t)regs->eax);
+ printf("ebx: %08x\t", (uint32_t)regs->ebx);
+ printf("ecx: %08x\t", (uint32_t)regs->ecx);
+ printf("edx: %08x\n", (uint32_t)regs->edx);
+
+ printf("esi: %08x\t", (uint32_t)regs->esi);
+ printf("edi: %08x\t", (uint32_t)regs->edi);
+ printf("ebp: %08x\n", (uint32_t)regs->ebp);
+
+ printf(" ds: %04x\t", regs->ds);
+ printf(" es: %04x\t", regs->es);
+ printf(" fs: %04x\t", regs->fs);
+ printf(" gs: %04x\n", regs->gs);
+
+ if (disp_all) {
+ print_special(ctx->ctrlreg, "cr", 0x1d, 4);
+ print_special(ctx->debugreg, "dr", 0xcf, 4);
+ }
+}
+
static void print_ctx_64(vcpu_guest_context_x86_64_t *ctx)
{
struct cpu_user_regs_x86_64 *regs = &ctx->user_regs;
@@ -336,6 +365,8 @@ static void print_ctx(vcpu_guest_context_any_t *ctx)
{
if (ctxt_word_size == 4)
print_ctx_32(&ctx->x32);
+ else if (guest_word_size == 4)
+ print_ctx_32on64(&ctx->x64);
else
print_ctx_64(&ctx->x64);
}