]> xenbits.xensource.com Git - xen.git/commitdiff
xenctx: Fix print_ctx_32on64's print_special call.
authorDon Slutz <dslutz@verizon.com>
Thu, 3 Apr 2014 19:07:09 +0000 (15:07 -0400)
committerIan Campbell <ian.campbell@citrix.com>
Fri, 4 Apr 2014 08:28:09 +0000 (09:28 +0100)
print_special() uses the width argument to both select output format
and array size.  So by passing 4 it expects an array of uint32_t.
But an array of uint64_t is passed.

So copy and mask the registers to 32 bits.

Signed-off-by: Don Slutz <dslutz@verizon.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
tools/xentrace/xenctx.c

index 665599049d8d342fb7a24b67338b65da1b16084f..82bd7895596daa03abb9c184cf081bf3887c927c 100644 (file)
@@ -420,8 +420,15 @@ static void print_ctx_32on64(vcpu_guest_context_x86_64_t *ctx)
     printf(" gs:     %04x\n", regs->gs);
 
     if (xenctx.disp_all) {
-        print_special(ctx->ctrlreg, "cr", 0x1d, cr_reg_mask, 4);
-        print_special(ctx->debugreg, "dr", 0xcf, dr_reg_mask, 4);
+        uint32_t tmp_regs[8];
+        int i;
+
+        for (i = 0; i < 5; i++)
+            tmp_regs[i] = ctx->ctrlreg[i];
+        print_special(tmp_regs, "cr", 0x1d, cr_reg_mask, 4);
+        for (i = 0; i < 8; i++)
+            tmp_regs[i] = ctx->debugreg[i];
+        print_special(tmp_regs, "dr", 0xcf, dr_reg_mask, 4);
     }
 }