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

Breakpoints

Use break to set a breakpoint. You can break on a function name, or you can give a filename:line specification to stop in a specific place.

Breakpoints can have conditions attached to them:

(​g​d​b​)​ ​b​r​e​a​k​ ​m​e​m​e​r​r​o​r​.​m​:​7​4​ ​i​f​ ​a​r​g​c​ ​!​=​ ​2​
B​r​e​a​k​p​o​i​n​t​ ​1​ ​a​t​ ​0​x​1​d​1​c​:​ ​f​i​l​e​ ​m​e​m​e​r​r​o​r​.​m​,​ ​l​i​n​e​ ​7​4​.​

This breakpoint will only be triggered if argc is not 2. You can also attach conditions after the breakpoint has been created using the cond command. You specify the condition using the syntax of whatever language you are debugging. If you are debugging an Ada or a FORTRAN program, you would use the logical syntax of those languages.

(​g​d​b​)​ ​c​o​n​d​ ​2​ ​(​a​r​g​c​ ...

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