diff options
author | Till Straumann <strauman@slac.stanford.edu> | 2009-10-20 14:51:37 +0000 |
---|---|---|
committer | Till Straumann <strauman@slac.stanford.edu> | 2009-10-20 14:51:37 +0000 |
commit | 020363de10aa687f7d14e61b6873c49f7187d009 (patch) | |
tree | d1f35e3b4dbf43c5c1bda6d02dbe87e1900e88b2 /cpukit/score/cpu/i386/cpu.c | |
parent | 2009-10-20 Till Straumann <strauman@slac.stanford.edu> (diff) | |
download | rtems-020363de10aa687f7d14e61b6873c49f7187d009.tar.bz2 |
2009-10-20 Till Straumann <strauman@slac.stanford.edu>
* score/cpu/i386/cpu.c, score/cpu/i386/cpu.h: let the default
exception handler print a stack trace.
Diffstat (limited to 'cpukit/score/cpu/i386/cpu.c')
-rw-r--r-- | cpukit/score/cpu/i386/cpu.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/cpukit/score/cpu/i386/cpu.c b/cpukit/score/cpu/i386/cpu.c index 46c12c5ae5..a3622d3156 100644 --- a/cpukit/score/cpu/i386/cpu.c +++ b/cpukit/score/cpu/i386/cpu.c @@ -85,6 +85,11 @@ void *_CPU_Thread_Idle_body( uintptr_t ignored ) return NULL; } +struct Frame_ { + struct Frame_ *up; + uintptr_t pc; +}; + void _defaultExcHandler (CPU_Exception_frame *ctx) { unsigned int faultAddr = 0; @@ -119,12 +124,24 @@ void _defaultExcHandler (CPU_Exception_frame *ctx) _CPU_Fatal_halt(faultAddr); } else { + struct Frame_ *fp = (struct Frame_*)ctx->ebp; + int i; + + printk("Call Stack Trace of EIP:\n"); + if ( fp ) { + for ( i=1; fp->up; fp=fp->up, i++ ) { + printk("0x%08x ",fp->pc); + if ( ! (i&3) ) + printk("\n"); + } + } + printk("\n"); /* * OK I could probably use a simplified version but at least this * should work. */ - printk(" ************ FAULTY THREAD WILL BE DELETED **************\n"); - rtems_task_delete(_Thread_Executing->Object.id); + printk(" ************ FAULTY THREAD WILL BE SUSPENDED **************\n"); + rtems_task_suspend(_Thread_Executing->Object.id); } } |