ia64/xen-unstable

changeset 19453:b7a11dff84c0

xenctx: Always show code context, even when not in kernel mode

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Mar 31 11:33:56 2009 +0100 (2009-03-31)
parents 192bc11d7506
children 6ad2b1ded12f
files tools/xentrace/xenctx.c
line diff
     1.1 --- a/tools/xentrace/xenctx.c	Tue Mar 31 11:32:56 2009 +0100
     1.2 +++ b/tools/xentrace/xenctx.c	Tue Mar 31 11:33:56 2009 +0100
     1.3 @@ -683,12 +683,30 @@ static void print_stack_word(guest_word_
     1.4          printf(FMT_64B_WORD, word);
     1.5  }
     1.6  
     1.7 +static void print_code(vcpu_guest_context_any_t *ctx, int vcpu)
     1.8 +{
     1.9 +    guest_word_t instr;
    1.10 +    int i;
    1.11 +
    1.12 +    printf("Code:\n");
    1.13 +    instr = instr_pointer(ctx) - 21;
    1.14 +    for(i=0; i<32; i++) {
    1.15 +        unsigned char *c = map_page(ctx, vcpu, instr+i);
    1.16 +        if (instr+i == instr_pointer(ctx))
    1.17 +            printf("<%02x> ", *c);
    1.18 +        else
    1.19 +            printf("%02x ", *c);
    1.20 +    }
    1.21 +    printf("\n");
    1.22 +
    1.23 +    printf("\n");
    1.24 +}
    1.25 +
    1.26  static void print_stack(vcpu_guest_context_any_t *ctx, int vcpu, int width)
    1.27  {
    1.28      guest_word_t stack = stack_pointer(ctx);
    1.29      guest_word_t stack_limit;
    1.30      guest_word_t frame;
    1.31 -    guest_word_t instr;
    1.32      guest_word_t word;
    1.33      guest_word_t *p;
    1.34      int i;
    1.35 @@ -709,19 +727,6 @@ static void print_stack(vcpu_guest_conte
    1.36      }
    1.37      printf("\n");
    1.38  
    1.39 -    printf("Code:\n");
    1.40 -    instr = instr_pointer(ctx) - 21;
    1.41 -    for(i=0; i<32; i++) {
    1.42 -        unsigned char *c = map_page(ctx, vcpu, instr+i);
    1.43 -        if (instr+i == instr_pointer(ctx))
    1.44 -            printf("<%02x> ", *c);
    1.45 -        else
    1.46 -            printf("%02x ", *c);
    1.47 -    }
    1.48 -    printf("\n");
    1.49 -
    1.50 -    printf("\n");
    1.51 -
    1.52      if(stack_trace)
    1.53          printf("Stack Trace:\n");
    1.54      else
    1.55 @@ -848,6 +853,7 @@ static void dump_ctx(int vcpu)
    1.56  #endif
    1.57  
    1.58      print_ctx(&ctx);
    1.59 +    print_code(&ctx, vcpu);
    1.60  #ifndef NO_TRANSLATION
    1.61      if (is_kernel_text(instr_pointer(&ctx)))
    1.62          print_stack(&ctx, vcpu, guest_word_size);