direct-io.hg

changeset 6477:872e94f8eb69

Fix x86/64 Xen register and stack dumps so they don't
wrap on an 80-column display.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
author kaf24@firebug.cl.cam.ac.uk
date Tue Aug 30 16:44:05 2005 +0000 (2005-08-30)
parents f0bf239844a6
children 6b48b53b682d
files xen/arch/x86/traps.c xen/arch/x86/x86_64/traps.c
line diff
     1.1 --- a/xen/arch/x86/traps.c	Tue Aug 30 16:19:07 2005 +0000
     1.2 +++ b/xen/arch/x86/traps.c	Tue Aug 30 16:44:05 2005 +0000
     1.3 @@ -100,6 +100,7 @@ unsigned long do_get_debugreg(int reg);
     1.4  
     1.5  static int debug_stack_lines = 20;
     1.6  integer_param("debug_stack_lines", debug_stack_lines);
     1.7 +#define stack_words_per_line (32 / BYTES_PER_LONG)
     1.8  
     1.9  int is_kernel_text(unsigned long addr)
    1.10  {
    1.11 @@ -125,7 +126,7 @@ void show_guest_stack(void)
    1.12  
    1.13      printk("Guest stack trace from "__OP"sp=%p:\n   ", stack);
    1.14  
    1.15 -    for ( i = 0; i < (debug_stack_lines*8); i++ )
    1.16 +    for ( i = 0; i < (debug_stack_lines*stack_words_per_line); i++ )
    1.17      {
    1.18          if ( ((long)stack & (STACK_SIZE-1)) == 0 )
    1.19              break;
    1.20 @@ -137,7 +138,7 @@ void show_guest_stack(void)
    1.21              i = 1;
    1.22              break;
    1.23          }
    1.24 -        if ( (i != 0) && ((i % 8) == 0) )
    1.25 +        if ( (i != 0) && ((i % stack_words_per_line) == 0) )
    1.26              printk("\n   ");
    1.27          printk("%p ", _p(addr));
    1.28          stack++;
    1.29 @@ -176,11 +177,11 @@ void show_stack(unsigned long *esp)
    1.30  
    1.31      printk("Xen stack trace from "__OP"sp=%p:\n   ", stack);
    1.32  
    1.33 -    for ( i = 0; i < (debug_stack_lines*8); i++ )
    1.34 +    for ( i = 0; i < (debug_stack_lines*stack_words_per_line); i++ )
    1.35      {
    1.36          if ( ((long)stack & (STACK_SIZE-1)) == 0 )
    1.37              break;
    1.38 -        if ( (i != 0) && ((i % 8) == 0) )
    1.39 +        if ( (i != 0) && ((i % stack_words_per_line) == 0) )
    1.40              printk("\n   ");
    1.41          addr = *stack++;
    1.42          printk("%p ", _p(addr));
     2.1 --- a/xen/arch/x86/x86_64/traps.c	Tue Aug 30 16:19:07 2005 +0000
     2.2 +++ b/xen/arch/x86/x86_64/traps.c	Tue Aug 30 16:44:05 2005 +0000
     2.3 @@ -15,19 +15,22 @@
     2.4  
     2.5  void show_registers(struct cpu_user_regs *regs)
     2.6  {
     2.7 -    printk("CPU:    %d\nEIP:    %04x:[<%016lx>]",
     2.8 +    printk("CPU:    %d\nRIP:    %04x:[<%016lx>]",
     2.9             smp_processor_id(), 0xffff & regs->cs, regs->rip);
    2.10      if ( !GUEST_MODE(regs) )
    2.11          print_symbol(" %s", regs->rip);
    2.12 -    printk("\nEFLAGS: %016lx\n", regs->eflags);
    2.13 -    printk("rax: %016lx   rbx: %016lx   rcx: %016lx   rdx: %016lx\n",
    2.14 -           regs->rax, regs->rbx, regs->rcx, regs->rdx);
    2.15 -    printk("rsi: %016lx   rdi: %016lx   rbp: %016lx   rsp: %016lx\n",
    2.16 -           regs->rsi, regs->rdi, regs->rbp, regs->rsp);
    2.17 -    printk("r8:  %016lx   r9:  %016lx   r10: %016lx   r11: %016lx\n",
    2.18 -           regs->r8,  regs->r9,  regs->r10, regs->r11);
    2.19 -    printk("r12: %016lx   r13: %016lx   r14: %016lx   r15: %016lx\n",
    2.20 -           regs->r12, regs->r13, regs->r14, regs->r15);
    2.21 +    printk("\nRFLAGS: %016lx\n", regs->eflags);
    2.22 +    printk("rax: %016lx   rbx: %016lx   rcx: %016lx\n",
    2.23 +           regs->rax, regs->rbx, regs->rcx);
    2.24 +    printk("rdx: %016lx   rsi: %016lx   rdi: %016lx\n",
    2.25 +           regs->rdx, regs->rsi, regs->rdi);
    2.26 +    printk("rbp: %016lx   rsp: %016lx   r8:  %016lx\n",
    2.27 +           regs->rbp, regs->rsp, regs->r8);
    2.28 +    printk("r9:  %016lx   r10: %016lx   r11: %016lx\n",
    2.29 +           regs->r9,  regs->r10, regs->r11);
    2.30 +    printk("r12: %016lx   r13: %016lx   r14: %016lx\n",
    2.31 +           regs->r12, regs->r13, regs->r14);
    2.32 +    printk("r15: %016lx\n", regs->r15);
    2.33  
    2.34      if ( GUEST_MODE(regs) )
    2.35          show_guest_stack();