GDB thread support?

gregory.menke at gsfc.nasa.gov gregory.menke at gsfc.nasa.gov
Thu Jun 5 21:59:42 UTC 2003



Joel Sherrill writes:
 > 
 > 
 > Kamen Penev wrote:
 > > 
 > > Hi!
 > > 
 > > I am sure this has come up before, but searching for "gdb thread" in the
 > > archives is not very productive ;-).
 > > 
 > > I would like to enable thread support in GDB when debugging an RTEMS
 > > application. My GDB talks to a debug monitor on the target (a DINK32
 > > variant). I will greatly appreciate any ideas or pointers to old posts,
 > > implementation notes etc. from someone who has done something similar
 > > before.
 > 
 > Unfortunately, the gdb thread support assumes some target level thread
 > support.  The regular gdb serial remote protocol includes commands which 
 > are thread related.  
 
The Mongoose V gdb stub is thread compliant (and C++ debugging works
as well.)  IIRC, the stub is rigged as shared libcpu code for MIPS
processors.  For it to work, the target bsp must support some kind of
debug exception that jumps to the stub and allows for a clean return
out of it.  The stub code itself is probably fairly portable, so the
key work is most likely getting the stack frame manipulation right and
handling the exceptions- this is stuff in cpukit/score/cpu.  The stub
will also need some means to talking to your remote gdb.  A 2nd serial
port is probably easiest, as all your bsp will have to supply at that
point is a simple putchar and getchar.

Gregm




More information about the users mailing list