views:

41

answers:

1

I have big process running. It spawns two threads. I want to debug those two threads separately. But there is only one gdb prompt. How to do this? Means I want to parallely see the execution of the threads.

+1  A: 

You can not run just some of the threads under the debugger. They will all run and they will all stop. Some thread may progress more than other, that depends on the scheduler of the OS and is out of the reach of the debugger. With that said, once you stop inside a break point you can review the threads one at a time. You can also set conditional breakpoints which will stop the execution only if a certain thread pass by them.

I think you will find that article useful:

http://ftp.gnu.org/old-gnu/Manuals/gdb-5.1.1/html_node/gdb_24.html#SEC25

Yordan Pavlov