aboutsummaryrefslogtreecommitdiffstats
path: root/tools/xentrace
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2009-03-31 11:33:56 +0100
committerKeir Fraser <keir.fraser@citrix.com>2009-03-31 11:33:56 +0100
commit49986faf5d961b5b3730c8791bc9b8d6fd811903 (patch)
tree2ef9a30acd9b20aab0e4bac31768fe39a1a2f5bc /tools/xentrace
parent03affb40e789671f1738560b2e2f2b0044e12fa3 (diff)
downloadxen-49986faf5d961b5b3730c8791bc9b8d6fd811903.tar.gz
xen-49986faf5d961b5b3730c8791bc9b8d6fd811903.tar.bz2
xen-49986faf5d961b5b3730c8791bc9b8d6fd811903.zip
xenctx: Always show code context, even when not in kernel mode
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Diffstat (limited to 'tools/xentrace')
-rw-r--r--tools/xentrace/xenctx.c34
1 files changed, 20 insertions, 14 deletions
diff --git a/tools/xentrace/xenctx.c b/tools/xentrace/xenctx.c
index d5ec038d9f..38edb3fb55 100644
--- a/tools/xentrace/xenctx.c
+++ b/tools/xentrace/xenctx.c
@@ -683,12 +683,30 @@ static void print_stack_word(guest_word_t word, int width)
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;
@@ -709,19 +727,6 @@ static void print_stack(vcpu_guest_context_any_t *ctx, int vcpu, int width)
}
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)
printf("Stack Trace:\n");
else
@@ -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);