ia64/xen-unstable
changeset 19181:a5bd5722360c
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>
Although x86_64 context covers x86_32, I think it's easy to watch.
Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
author | Keir Fraser <keir.fraser@citrix.com> |
---|---|
date | Fri Feb 06 10:43:58 2009 +0000 (2009-02-06) |
parents | 4fcf4c9c9751 |
children | 3c44c7dcf482 |
files | tools/xentrace/xenctx.c |
line diff
1.1 --- a/tools/xentrace/xenctx.c Fri Feb 06 10:42:26 2009 +0000 1.2 +++ b/tools/xentrace/xenctx.c Fri Feb 06 10:43:58 2009 +0000 1.3 @@ -288,6 +288,35 @@ static void print_ctx_32(vcpu_guest_cont 1.4 } 1.5 } 1.6 1.7 +static void print_ctx_32on64(vcpu_guest_context_x86_64_t *ctx) 1.8 +{ 1.9 + struct cpu_user_regs_x86_64 *regs = &ctx->user_regs; 1.10 + 1.11 + printf("cs:eip: %04x:%08x ", regs->cs, (uint32_t)regs->eip); 1.12 + print_symbol((uint32_t)regs->eip); 1.13 + print_flags((uint32_t)regs->eflags); 1.14 + printf("ss:esp: %04x:%08x\n", regs->ss, (uint32_t)regs->esp); 1.15 + 1.16 + printf("eax: %08x\t", (uint32_t)regs->eax); 1.17 + printf("ebx: %08x\t", (uint32_t)regs->ebx); 1.18 + printf("ecx: %08x\t", (uint32_t)regs->ecx); 1.19 + printf("edx: %08x\n", (uint32_t)regs->edx); 1.20 + 1.21 + printf("esi: %08x\t", (uint32_t)regs->esi); 1.22 + printf("edi: %08x\t", (uint32_t)regs->edi); 1.23 + printf("ebp: %08x\n", (uint32_t)regs->ebp); 1.24 + 1.25 + printf(" ds: %04x\t", regs->ds); 1.26 + printf(" es: %04x\t", regs->es); 1.27 + printf(" fs: %04x\t", regs->fs); 1.28 + printf(" gs: %04x\n", regs->gs); 1.29 + 1.30 + if (disp_all) { 1.31 + print_special(ctx->ctrlreg, "cr", 0x1d, 4); 1.32 + print_special(ctx->debugreg, "dr", 0xcf, 4); 1.33 + } 1.34 +} 1.35 + 1.36 static void print_ctx_64(vcpu_guest_context_x86_64_t *ctx) 1.37 { 1.38 struct cpu_user_regs_x86_64 *regs = &ctx->user_regs; 1.39 @@ -336,6 +365,8 @@ static void print_ctx(vcpu_guest_context 1.40 { 1.41 if (ctxt_word_size == 4) 1.42 print_ctx_32(&ctx->x32); 1.43 + else if (guest_word_size == 4) 1.44 + print_ctx_32on64(&ctx->x64); 1.45 else 1.46 print_ctx_64(&ctx->x64); 1.47 }