[ECOS] How to get thread state info?

Nick Garnett nickg@ecoscentric.com
Mon Dec 9 11:06:00 GMT 2002

Grant Edwards <grante@visi.com> writes:

> For troubleshooting purposes, I would like to be abled to
> display the states of all the threads in the system (SP, IP,
> thread state, backtrace).  Are there any existing methods to do
> something like that?

Well, GDB will do it.

But I assume that you want to do it from within eCos. In which case,
at the present the answer is no. However, I do have some code I have
been working on myself that does most of what you are after:
enumerating all the threads and getting some info from them (state,
priority, stack base and size etc.).

Some of the things you want are not very easy. SP and IP are
architecture specific. We would have to add new macros to every HAL to
extract them from saved thread states. Backtrace is really hard, GDB
contains all sorts of dodgy heuristics to try and get this right. We
couldn't possibly duplicate that on the target.

I'll see if I can check the code I have into the repository.

Nick Garnett - eCos Kernel Architect

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

More information about the Ecos-discuss mailing list