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

[Xen-changelog] [xen-unstable] xenctx: Always show code context, even when not in kernel mode



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1238495636 -3600
# Node ID b7a11dff84c06fdbb021b9719060b9cadba4d02c
# Parent  192bc11d750653225f3f4a90e078503cdaf003c2
xenctx: Always show code context, even when not in kernel mode

Signed-off-by: George Dunlap <george.dunlap@xxxxxxxxxxxxx>
---
 tools/xentrace/xenctx.c |   34 ++++++++++++++++++++--------------
 1 files changed, 20 insertions(+), 14 deletions(-)

diff -r 192bc11d7506 -r b7a11dff84c0 tools/xentrace/xenctx.c
--- a/tools/xentrace/xenctx.c   Tue Mar 31 11:32:56 2009 +0100
+++ b/tools/xentrace/xenctx.c   Tue Mar 31 11:33:56 2009 +0100
@@ -683,12 +683,30 @@ static void print_stack_word(guest_word_
         printf(FMT_64B_WORD, word);
 }
 
+static void print_code(vcpu_guest_context_any_t *ctx, int vcpu)
+{
+    guest_word_t instr;
+    int i;
+
+    printf("Code:\n");
+    instr = instr_pointer(ctx) - 21;
+    for(i=0; i<32; i++) {
+        unsigned char *c = map_page(ctx, vcpu, instr+i);
+        if (instr+i == instr_pointer(ctx))
+            printf("<%02x> ", *c);
+        else
+            printf("%02x ", *c);
+    }
+    printf("\n");
+
+    printf("\n");
+}
+
 static void print_stack(vcpu_guest_context_any_t *ctx, int vcpu, int width)
 {
     guest_word_t stack = stack_pointer(ctx);
     guest_word_t stack_limit;
     guest_word_t frame;
-    guest_word_t instr;
     guest_word_t word;
     guest_word_t *p;
     int i;
@@ -707,19 +725,6 @@ static void print_stack(vcpu_guest_conte
         }
         printf("\n");
     }
-    printf("\n");
-
-    printf("Code:\n");
-    instr = instr_pointer(ctx) - 21;
-    for(i=0; i<32; i++) {
-        unsigned char *c = map_page(ctx, vcpu, instr+i);
-        if (instr+i == instr_pointer(ctx))
-            printf("<%02x> ", *c);
-        else
-            printf("%02x ", *c);
-    }
-    printf("\n");
-
     printf("\n");
 
     if(stack_trace)
@@ -848,6 +853,7 @@ static void dump_ctx(int vcpu)
 #endif
 
     print_ctx(&ctx);
+    print_code(&ctx, vcpu);
 #ifndef NO_TRANSLATION
     if (is_kernel_text(instr_pointer(&ctx)))
         print_stack(&ctx, vcpu, guest_word_size);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

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