Copyright ã1996 by NeXT Software, Inc.  All Rights Reserved.

;ChangingProgramExecutionWhileDebugging.rtfd;;¬  Next Section	;DebuggingObjectAllocationAndDeallocation.rtfd;;¬  Previous Section

Debuggingamultithreadedprogram;¬Debugging a multithreaded program

¬	Use the gdb comand thread-list to obtain information about all of the threads running in the program. 

¬	Use the thread-select command to switch to a different thread. 

A single program may have more than one thread of execution. A thread is an executable unit that has its own stack and is capable of independent I/O, but shares the address space of the other threads in a task. 

gdb allows you to observe all threads while your program runs, but whenever gdb takes control, one thread in particular is always the focus of debugging. This thread is called the current thread. Debugging commands show program information from the perspective of the current thread. If you want to change to a different thread, use the thread-select command (passing it the thread number, which is displayed in the first column of the thread-list output).

¬