Changing Execution Flow

You can bail out of a function early with return. For functions that return values, you can also specify a return value. This is very useful if you know the function is going to return a bad value and you know what it should be returning.

finish will continue execution until the current function ends and then gdb will break back in again. until will resume execution and break on the next instruction after where until was invoked. This is useful (as seen above) for letting a loop finish.

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.