Debugging with GDB (February 2008)

Table Of Contents
Chapter 5: Stopping and Continuing 37
longjmp resume
Internal breakpoint at the target of a longjmp.
until Temporary internal breakpoint used by the GDB until command.
finish Temporary internal breakpoint used by the GDB finish command.
shlib events
Shared library events.
5.1.2 Setting catchpoints
You can use catchpoints to cause the debugger to stop for certain kinds of program
events, such as C++ exceptions or the loading of a shared library. Use the catch command
to set a catchpoint.
catch event
Stop when event occurs. event can be any of the following:
throw The throwing of a C++ exception.
catch The catching of a C++ exception.
exec A call to exec. This is currently only available for HP-UX.
fork A call to fork. This is currently only available for HP-UX.
vfork A call to vfork. This is currently only available for HP-UX.
load
load libname
The dynamic loading of any shared library, or the loading of the
library libname. This is currently only available for HP-UX.
unload
unload libname
The unloading of any dynamically loaded shared library, or the
unloading of the library libname. This is currently only available
for HP-UX.
tcatch event
Set a catchpoint that is enabled only for one stop. The catchpoint is automat-
ically deleted after the first time the event is caught.
Use the info break command to list the current catchpoints.
There are currently some limitations to C++ exception handling (catch throw and catch
catch) in GDB:
If you call a function interactively, GDB normally returns control to you when the
function has finished executing. If the call raises an exception, however, the call may
bypass the mechanism that returns control to you and cause your program either to
abort or to simply continue running until it hits a breakpoint, catches a signal that
GDB is listening for, or exits. This is the case even if you set a catchpoint for the
exception; catchpoints on exceptions are disabled within interactive calls.