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: Kevin Buettner
Subject: Re: gdb help, attaching to specific threads
Date: Fri, 7 Dec 2001 12:57:21 -0700

On Dec 7,  2:12pm, 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?  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,which is what usually happens when I use 1 instance of gdb to debug
> threads.

You didn't say which host/target you're using, nor the version of GDB
that you're using.  In any event, GDB can be used to attach to a
multithreaded program.  You should be able to follow the activites of
your threads by using a single GDB.  (Take a look at the ``thread''
and ``info thread'' commands.)  To the best of my knowledge, it is
not possible to use separate GDB processes to follow multiple threads. 
(Though this could probably be done without too much difficulty on
Linux by building a GDB which doesn't have thread support and then
separately attaching to the pids which represent the process's
threads.)

Kevin



reply via email to

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