ia64/xen-unstable

changeset 12965:38b437a708a2

[XEN][POWERPC] Fix Register dumping from ^A^A^A console
Signed-off-by: Jimi Xenidis <jimix@watson.ibm.com>
Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
author Jimi Xenidis <jimix@watson.ibm.com>
date Wed Nov 22 16:09:28 2006 -0500 (2006-11-22)
parents f911e945d959
children 530597f5387f
files xen/arch/powerpc/backtrace.c xen/include/asm-powerpc/debugger.h
line diff
     1.1 --- a/xen/arch/powerpc/backtrace.c	Wed Nov 22 14:53:13 2006 -0500
     1.2 +++ b/xen/arch/powerpc/backtrace.c	Wed Nov 22 16:09:28 2006 -0500
     1.3 @@ -220,3 +220,15 @@ void __warn(char *file, int line)
     1.4  
     1.5      console_end_sync();
     1.6  }
     1.7 +
     1.8 +void dump_execution_state(void)
     1.9 +{
    1.10 +    struct vcpu *v = current;
    1.11 +    struct cpu_user_regs *regs = &v->arch.ctxt;
    1.12 +
    1.13 +    show_registers(regs);
    1.14 +    if (regs->msr & MSR_HV) {
    1.15 +        printk("In Xen:\n");
    1.16 +        show_backtrace(regs->gprs[1], regs->pc, regs->lr);
    1.17 +    }
    1.18 +}
     2.1 --- a/xen/include/asm-powerpc/debugger.h	Wed Nov 22 14:53:13 2006 -0500
     2.2 +++ b/xen/include/asm-powerpc/debugger.h	Wed Nov 22 16:09:28 2006 -0500
     2.3 @@ -27,11 +27,19 @@
     2.4  extern void show_backtrace_regs(struct cpu_user_regs *);
     2.5  extern void show_backtrace(ulong sp, ulong lr, ulong pc);
     2.6  
     2.7 -static inline void dump_execution_state(void)
     2.8 +static inline void show_execution_state(struct cpu_user_regs *regs)
     2.9 +{
    2.10 +    show_registers(regs);
    2.11 +}
    2.12 +
    2.13 +extern void dump_execution_state(void);
    2.14 +
    2.15 +static inline void dump_all_execution_state(void)
    2.16  {
    2.17      ulong sp;
    2.18      ulong lr;
    2.19  
    2.20 +    dump_execution_state();
    2.21      sp = (ulong)__builtin_frame_address(0);
    2.22      lr = (ulong)__builtin_return_address(0);
    2.23  
    2.24 @@ -40,13 +48,13 @@ static inline void dump_execution_state(
    2.25  
    2.26  static inline void __force_crash(void)
    2.27  {
    2.28 -    dump_execution_state();
    2.29 +    dump_all_execution_state();
    2.30      __builtin_trap();
    2.31  }
    2.32  
    2.33  static inline void debugger_trap_immediate(void)
    2.34  {
    2.35 -    dump_execution_state();
    2.36 +    dump_all_execution_state();
    2.37  #ifdef CRASH_DEBUG
    2.38      __builtin_trap();
    2.39  #endif
    2.40 @@ -55,15 +63,10 @@ static inline void debugger_trap_immedia
    2.41  static inline void unimplemented(void)
    2.42  {
    2.43  #ifdef VERBOSE
    2.44 -    dump_execution_state();
    2.45 +    dump_all_execution_state();
    2.46  #endif
    2.47  }
    2.48  
    2.49 -static inline void show_execution_state(struct cpu_user_regs *regs)
    2.50 -{
    2.51 -    show_registers(regs);
    2.52 -}
    2.53 -
    2.54  extern void __warn(char *file, int line);
    2.55  #define WARN() __warn(__FILE__, __LINE__)
    2.56  #define WARN_ON(_p) do { if (_p) WARN(); } while ( 0 )