public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS]  Stack Trace and running task when exception occurs -
@ 2007-09-09 11:02 Alok Singh
  2007-09-09 16:37 ` Andrew Lunn
  0 siblings, 1 reply; 3+ messages in thread
From: Alok Singh @ 2007-09-09 11:02 UTC (permalink / raw)
  To: ecos-discuss


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.

Thanks.
regards,
Alok


--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [ECOS]  Stack Trace and running task when exception occurs -
  2007-09-09 11:02 [ECOS] Stack Trace and running task when exception occurs - Alok Singh
@ 2007-09-09 16:37 ` Andrew Lunn
  2007-09-09 20:18   ` Sergei Gavrikov
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Lunn @ 2007-09-09 16:37 UTC (permalink / raw)
  To: Alok Singh; +Cc: ecos-discuss

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [ECOS]  Stack Trace and running task when exception occurs -
  2007-09-09 16:37 ` Andrew Lunn
@ 2007-09-09 20:18   ` Sergei Gavrikov
  0 siblings, 0 replies; 3+ messages in thread
From: Sergei Gavrikov @ 2007-09-09 20:18 UTC (permalink / raw)
  To: Alok Singh, ecos-discuss

On Sun, Sep 09, 2007 at 06:36:55PM +0200, Andrew Lunn wrote:
> 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

If ARM arch. is yours, try to build and run the eCos exception test:
kernel/tests/except1, without (default) and then with this option

# Provide diagnostic dump for exceptions
# Print messages about hardware exceptions, including
# raw exception frame dump and register contents.
#
cdl_option CYGHWR_HAL_ARM_DUMP_EXCEPTIONS {
    # Flavor: bool
    # No user value, uncomment the following line to provide one.
    user_value 1
    # value_source default
    # Default value: 0
    # Requires: !CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS
    #     CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS == 0
    #   --> 1
}

With the option is turned on, you will get info about the latest CPU
state (PC, registers, stack frame).

	Sergei


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-09-09 20:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-09-09 11:02 [ECOS] Stack Trace and running task when exception occurs - Alok Singh
2007-09-09 16:37 ` Andrew Lunn
2007-09-09 20:18   ` Sergei Gavrikov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).