[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH v3 14/16] xenctx: Add convert of more registers to symbols



From: Don Slutz <dslutz@xxxxxxxxxxx>

For example can change:
 gs: 0000 @ ffffffff803ac000/0000000000000000
to
 gs: 0000 @ ffffffff803ac000/0000000000000000 boot_cpu_pda/

Signed-off-by: Don Slutz <dslutz@xxxxxxxxxxx>
---
Changed since v2:
  * Extract just the symbol printing code from "xenctx: Dump registers via hvm 
info if available"

 tools/xentrace/xenctx.c | 24 ++++++++++++++++++------
 1 file changed, 18 insertions(+), 6 deletions(-)

diff --git a/tools/xentrace/xenctx.c b/tools/xentrace/xenctx.c
index 23f2199..d0398da 100644
--- a/tools/xentrace/xenctx.c
+++ b/tools/xentrace/xenctx.c
@@ -317,10 +317,14 @@ static void print_special(void *regs, const char *name, 
unsigned int mask, int w
     printf("\n");
     for (i = 0; mask; mask >>= 1, ++i)
         if (mask & 1) {
-            if (width == 4)
-                printf("%s%u: %08"PRIx32"\n", name, i, ((uint32_t *) regs)[i]);
-            else
-                printf("%s%u: %08"PRIx64"\n", name, i, ((uint64_t *) regs)[i]);
+            if (width == 4) {
+                printf("%s%u: %08"PRIx32, name, i, ((uint32_t *) regs)[i]);
+                print_symbol(((uint32_t *) regs)[i], KERNEL_DATA_ADDR);
+            } else {
+                printf("%s%u: %016"PRIx64, name, i, ((uint64_t *) regs)[i]);
+                print_symbol(((uint64_t *) regs)[i], KERNEL_DATA_ADDR);
+            }
+            printf("\n");
         }
 }
 
@@ -416,9 +420,17 @@ static void print_ctx_64(vcpu_guest_context_x86_64_t *ctx)
     printf(" ds: %04x\t", regs->ds);
     printf(" es: %04x\n", regs->es);
 
-    printf(" fs: %04x @ %016"PRIx64"\n", regs->fs, ctx->fs_base);
-    printf(" gs: %04x @ %016"PRIx64"/%016"PRIx64"\n", regs->gs,
+    printf(" fs: %04x @ %016"PRIx64, regs->fs, ctx->fs_base);
+    print_symbol(ctx->fs_base, KERNEL_DATA_ADDR);
+    printf("\n");
+    printf(" gs: %04x @ %016"PRIx64"/%016"PRIx64, regs->gs,
            ctx->gs_base_kernel, ctx->gs_base_user);
+    if (symbol_table) {
+        print_symbol(ctx->gs_base_kernel, KERNEL_DATA_ADDR);
+        printf("/");
+        print_symbol(ctx->gs_base_user, KERNEL_DATA_ADDR);
+    }
+    printf("\n");
 
     if (xenctx.disp_all) {
         print_special(ctx->ctrlreg, "cr", 0x1d, 8);
-- 
1.8.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.