This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Re: Stack Trace and running task when exception occurs -
- From: Andrew Lunn <andrew at lunn dot ch>
- To: Alok Singh <aloks at broadcom dot com>
- Cc: ecos-discuss at ecos dot sourceware dot org
- Date: Sun, 9 Sep 2007 18:36:55 +0200
- Subject: Re: [ECOS] Stack Trace and running task when exception occurs -
- References: <FE7FB54DCB7C6949A1D3F9FF22DA6C13848657@lvl7in-mail01.lvl7.com>
On Sun, Sep 09, 2007 at 04:32:10PM +0530, Alok Singh wrote:
>
> Hi,
>
> Does eCos provides the details of the task that was running when
> exception occurred? I think I know that it doesn't, but just wanted
> to get your views?? Or is there a way to get this information
> without altering (enhancing) the current eCos code.
It depends on what details you want. cyg_thread_self() will tell you
the current thread. However, be careful, it could of been an ISR/DSR
that caused the exception, not the thread.
If you have a hardware exception, eg /0, sigfault etc, the info
parameter passed to the exception handler may be the saved
registers. This is architecture dependent. eg look at
packages/hal/arm/arch/current/src/hal_misc.c lines 136-158 and follow
the code patch though into your exception handler.
Andrew
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss