aboutsummaryrefslogtreecommitdiffstats
path: root/tools/xentrace/xenctx.c
diff options
context:
space:
mode:
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>2005-07-11 08:59:01 +0000
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>2005-07-11 08:59:01 +0000
commit1c86b5d22b3142604a423aa5ae9498d18858973d (patch)
treef3a4406c9208000898ba8ec7b6db2e8a032be937 /tools/xentrace/xenctx.c
parent68b45c11cd3bd2a577c069a36401594facbd5b83 (diff)
downloadxen-1c86b5d22b3142604a423aa5ae9498d18858973d.tar.gz
xen-1c86b5d22b3142604a423aa5ae9498d18858973d.tar.bz2
xen-1c86b5d22b3142604a423aa5ae9498d18858973d.zip
Fix xenctx compilation and support 64 bit.
Signed-off-by: Arun Sharma <arun.sharma@intel.com>
Diffstat (limited to 'tools/xentrace/xenctx.c')
-rw-r--r--tools/xentrace/xenctx.c62
1 files changed, 47 insertions, 15 deletions
diff --git a/tools/xentrace/xenctx.c b/tools/xentrace/xenctx.c
index 28dfd360ac..1744fc1956 100644
--- a/tools/xentrace/xenctx.c
+++ b/tools/xentrace/xenctx.c
@@ -28,22 +28,55 @@ void print_ctx(vcpu_guest_context_t *ctx1)
{
struct cpu_user_regs *regs = &ctx1->user_regs;
- printf("eip: %08lx\t", regs->eip);
- printf("esp: %08lx\n", regs->esp);
+ printf("eip: %08x\t", regs->eip);
+ printf("esp: %08x\n", regs->esp);
- printf("eax: %08lx\t", regs->eax);
- printf("ebx: %08lx\t", regs->ebx);
- printf("ecx: %08lx\t", regs->ecx);
- printf("edx: %08lx\n", regs->edx);
+ printf("eax: %08x\t", regs->eax);
+ printf("ebx: %08x\t", regs->ebx);
+ printf("ecx: %08x\t", regs->ecx);
+ printf("edx: %08x\n", regs->edx);
- printf("esi: %08lx\t", regs->esi);
- printf("edi: %08lx\t", regs->edi);
- printf("ebp: %08lx\n", regs->ebp);
+ printf("esi: %08x\t", regs->esi);
+ printf("edi: %08x\t", regs->edi);
+ printf("ebp: %08x\n", regs->ebp);
- printf(" cs: %08lx\t", regs->cs);
- printf(" ds: %08lx\t", regs->ds);
- printf(" fs: %08lx\t", regs->fs);
- printf(" gs: %08lx\n", regs->gs);
+ printf(" cs: %08x\t", regs->cs);
+ printf(" ds: %08x\t", regs->ds);
+ printf(" fs: %08x\t", regs->fs);
+ printf(" gs: %08x\n", regs->gs);
+
+}
+#elif defined(__x86_64__)
+void print_ctx(vcpu_guest_context_t *ctx1)
+{
+ struct cpu_user_regs *regs = &ctx1->user_regs;
+
+ printf("rip: %08lx\t", regs->rip);
+ printf("rsp: %08lx\n", regs->rsp);
+
+ printf("rax: %08lx\t", regs->rax);
+ printf("rbx: %08lx\t", regs->rbx);
+ printf("rcx: %08lx\t", regs->rcx);
+ printf("rdx: %08lx\n", regs->rdx);
+
+ printf("rsi: %08lx\t", regs->rsi);
+ printf("rdi: %08lx\t", regs->rdi);
+ printf("rbp: %08lx\n", regs->rbp);
+
+ printf("r8: %08lx\t", regs->r8);
+ printf("r9: %08lx\t", regs->r9);
+ printf("r10: %08lx\t", regs->r10);
+ printf("r11: %08lx\n", regs->r11);
+
+ printf("r12: %08lx\t", regs->r12);
+ printf("r13: %08lx\t", regs->r13);
+ printf("r14: %08lx\t", regs->r14);
+ printf("r15: %08lx\n", regs->r15);
+
+ printf(" cs: %08x\t", regs->cs);
+ printf(" ds: %08x\t", regs->ds);
+ printf(" fs: %08x\t", regs->fs);
+ printf(" gs: %08x\n", regs->gs);
}
#endif
@@ -51,12 +84,11 @@ void print_ctx(vcpu_guest_context_t *ctx1)
void dump_ctx(u32 domid, u32 vcpu)
{
int ret;
- xc_domaininfo_t info;
vcpu_guest_context_t ctx;
int xc_handle = xc_interface_open(); /* for accessing control interface */
- ret = xc_domain_getfullinfo(xc_handle, domid, vcpu, &info, &ctx);
+ ret = xc_domain_get_vcpu_context(xc_handle, domid, vcpu, &ctx);
if (ret != 0) {
perror("xc_domain_getfullinfo");
exit(-1);