Breaking in a specific thread.

Joel Sherrill <joel@OARcorp.com> joel.sherrill at OARcorp.com
Fri Dec 10 19:42:11 UTC 2004


Aaron J. Grier wrote:
> On Fri, Dec 10, 2004 at 09:23:10AM -0700, Steve Holle wrote:
> 
>>Does anyone have a technique for breaking in a specific thread?
> 
> 
> could you set a watchpoint in RTEMS' context switcher with your
> debugger?  (inside _Thread_Dispatch I'm thinking)

I have used a gdb condition to do this.  It is something like this:

condition 1 _Thread_Executing == XXX
condition 2 _Thread_Executing->Object.id == XXX
break mythread.c:LINE if 1

If you don't change the set of RTEMS objects, then RTEMS Ids
and pointers into the workspace don't change from run to run
on most BSPs.

You can also define break "commands" that are sets of commands
to be executed at a breakpoint.  But I have never used them.

Some gdb remote stubs are thread aware and you should be able to
use the gdb thread commands on those.  But the above works on
any target setup.

-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel at OARcorp.com                 On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
    Support Available             (256) 722-9985




More information about the users mailing list