O'Reilly logo

Advanced Mac OS X Programming: The Big Nerd Ranch Guide by Mark Dalrymple

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

More Advanced GDB Commands

Threads

gdb supports debugging threaded programs. We have lots to say about threading issues in Chapter 20: Multithreading, but for now, here are some useful commands relating to threads.

info threads

Shows information about all the currently active threads. Here is something from a simple Cocoa program while the Page Setup dialog is active:

(​g​d​b​)​ ​i​n​f​o​ ​t​h​r​e​a​d​s​ ​3​ ​p​r​o​c​e​s​s​ ​1​2​8​ ​t​h​r​e​a​d​ ​0​x​2​1​3​ ​0​x​7​0​9​7​8​ ​i​n​ ​m​a​c​h​_​m​s​g​_​o​v​e​r​w​r​i​t​e​_​t​r​a​p​(​)​ ​2​ ​p​r​o​c​e​s​s​ ​1​2​8​ ​t​h​r​e​a​d​ ​0​x​1​f​7​ ​0​x​7​0​9​7​8​ ​i​n​ ​m​a​c​h​_​m​s​g​_​o​v​e​r​w​r​i​t​e​_​t​r​a​p​(​)​ *​1​ ​p​r​o​c​e​s​s​ ​1​2​8​ ​t​h​r​e​a​d​ ​0​x​1​6​3​ ​0​x​7​0​9​7​8​ ​i​n​ ​m​a​c​h​_​m​s​g​_​o​v​e​r​w​r​i​t​e​_​t​r​a​p​(​)​ ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required