bug-gdb
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gdb help, attaching to specific threads


From: Michael Snyder
Subject: Re: gdb help, attaching to specific threads
Date: Fri, 07 Dec 2001 12:09:36 -0800

Shane McDaniel wrote:
> 
> I have a program that creates a thread and I would like to be able to use
> two instances of gdb to follow each thread separately, ie the main thread
> and the thread I create.  Attaching to the main one is easy enough but how
> do I attach to the second? 

In general, that is not possible.

> and how do I keep the gdb on the main thread
> from jumping over to the second thread when I hit a break point in
> it,

That you can do: just make the breakpoints "thread-specific".
Use "info threads" to get the thread ID of the main thread.
Let's assume it's thread 100.  Then when you set a breakpoint, 
you would say

        break foo thread 100

Michael



reply via email to

[Prev in Thread] Current Thread [Next in Thread]