Information Technology Reference
In-Depth Information
Working with Command-Line Debugging
The (gdb) text at the bottom of the console window is a command-line prompt. You can enter text commands
to the GDB debugger to reveal details that can't be accessed with the standard debugging tools.
The complete list of GDB commands includes hundreds of entries, and it's unlikely that any Xcode user has
ever memorized them all. Many commands are legacy features left over from GDB's origins. Although interest-
ing, they're not essential if you're working with a high-level language such as Objective-C. Others can provide
useful insights. Table 15.3 shows a small selection.
Figure 15.22 shows an example of GDB command-line control. The help command lists the main command
groups, and the backtrace command displays a stack dump. Note that standard breakpoints support GDB com-
mands. You can type in a command as a breakpoint action, and GBD prints the output to the console. Use this
feature to print extra information about objects without using NSLog or to modify test conditions. For ex-
ample, one breakpoint can set or delete another automatically.
Search WWH ::




Custom Search