[ECOS] BDI JTAG debugger and threads

Øyvind Harboe oyvind.harboe@zylin.com
Tue Apr 13 11:30:00 GMT 2004

On Fri, 2004-04-02 at 16:45, Gary Thomas wrote:
> Øyvind Harboe said:
> > Is it possible to to get GDB threads support when running with a JTAG
> > debugger?
> >
> > I'm debugging a deadlock in lwIP on EB40a running SLIP, and this would
> > be most welcome.
> Not without a whole lot of work - GDB needs to ask the JTAG (which is
> talking the GDB protocol, I presume) about the thread information.  The
> JTAG device in turn would need to know these details.  On eCos, the
> details are hard to come by, since there's no fixed thread table, etc.,
> all of the internal thread structures have to be walked.  This is more
> than one might want to do in the JTAG box (and I doubt it has been done).
> We did make this work sometime in the past, but it was complicated and
> IIRC never was released.
> Short summary, sorry but no.

If we can't have GDB support for threads w/JTAG debuggers, how about
this alternative approach:

- When GDB is at a breakpoint, it is possible to interactively execute
an arbitary C function, e.g. by evaulating a C expression which includes
a C function. 
- Define a new global eCos function, e.g. ThreadSwitch(), which puts the
current thread on the "ready threads list" and takes the next thread on
the ready or sleeping list and switches to that context.
- Before continuing execution, the original thread context must  be

This gives some ability to manually switch thread contexts and examine
each thread, even if the GDB JTAG debugger is thread unaware. 


Øyvind Harboe

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

More information about the Ecos-discuss mailing list