Changeset 020363d in rtems


Ignore:
Timestamp:
Oct 20, 2009, 2:51:37 PM (10 years ago)
Author:
Till Straumann <strauman@…>
Branches:
4.10, 4.11, master
Children:
45061bf
Parents:
f8397280
Message:

2009-10-20 Till Straumann <strauman@…>

  • score/cpu/i386/cpu.c, score/cpu/i386/cpu.h: let the default exception handler print a stack trace.
Location:
cpukit
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    rf8397280 r020363d  
     12009-10-20      Till Straumann <strauman@slac.stanford.edu>
     2
     3        * score/cpu/i386/cpu.c, score/cpu/i386/cpu.h: let the default
     4        exception handler print a stack trace.
     5
    162009-10-20      Till Straumann <strauman@slac.stanford.edu>
    27
  • cpukit/score/cpu/i386/cpu.c

    rf8397280 r020363d  
    8686}
    8787
     88struct Frame_ {
     89        struct Frame_  *up;
     90        uintptr_t               pc;
     91};
     92
    8893void _defaultExcHandler (CPU_Exception_frame *ctx)
    8994{
     
    120125  }
    121126  else {
     127        struct Frame_ *fp = (struct Frame_*)ctx->ebp;
     128        int           i;
     129
     130        printk("Call Stack Trace of EIP:\n");
     131        if ( fp ) {
     132                for ( i=1; fp->up; fp=fp->up, i++ ) {
     133                        printk("0x%08x ",fp->pc);
     134                        if ( ! (i&3) )
     135                                printk("\n");
     136                }
     137        }
     138        printk("\n");
    122139    /*
    123140     * OK I could probably use a simplified version but at least this
    124141     * should work.
    125142     */
    126     printk(" ************ FAULTY THREAD WILL BE DELETED **************\n");
    127     rtems_task_delete(_Thread_Executing->Object.id);
     143    printk(" ************ FAULTY THREAD WILL BE SUSPENDED **************\n");
     144    rtems_task_suspend(_Thread_Executing->Object.id);
    128145  }
    129146}
  • cpukit/score/cpu/i386/rtems/score/cpu.h

    rf8397280 r020363d  
    301301    else          (_the_context)->eflags = CPU_EFLAGS_INTERRUPTS_ON; \
    302302    \
    303     _stack = ((uint32_t)(_stack_base)) + (_size) - 4; \
     303    _stack = ((uint32_t)(_stack_base)) + (_size) - sizeof(proc_ptr*); \
    304304    \
    305305    *((proc_ptr *)(_stack)) = (_entry_point); \
    306     (_the_context)->ebp     = (void *) _stack; \
     306    (_the_context)->ebp     = (void *) 0; \
    307307    (_the_context)->esp     = (void *) _stack; \
    308308  } while (0)
Note: See TracChangeset for help on using the changeset viewer.