8Debugging With GDB

What Is a Debugger?

A debugger is a program that runs your program and has the power to suspend its execution and poke around in memory, examining and changing memory values. It can catch your program after it runs into trouble so you can investigate the problem. Debuggers know about the data structures you are using and can display those structures in an intelligent way. You can experiment with your program, and you can also step through someone else’s code to figure out how it works.

Mac OS X comes with gdb, the GNU project’s debugger, which has a long heritage dating back to 1988. It is fundamentally a command-line oriented tool, but it has been extended over the years to make integration into IDEs, like Xcode and emacs ...

Get Advanced Mac OS X Programming: The Big Nerd Ranch Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.