Debugging with GDB: Ada Exception GDB/MI Catchpoint Commands |
---|
Previous: Shared Library GDB/MI Catchpoint Commands, Up: GDB/MI Catchpoint Commands [Contents][Index]
The following GDB/MI commands can be used to create catchpoints that stop the execution when Ada exceptions are being raised.
-catch-assert
Command-catch-assert [ -c condition] [ -d ] [ -t ]
Add a catchpoint for failed Ada assertions.
The possible optional parameters for this command are:
Make the catchpoint conditional on condition.
Create a disabled catchpoint.
Create a temporary catchpoint.
The corresponding GDB command is ‘catch assert’.
-catch-assert ^done,bkptno="5",bkpt={number="5",type="breakpoint",disp="keep", enabled="y",addr="0x0000000000404888",what="failed Ada assertions", thread-groups=["i1"],times="0", original-location="__gnat_debug_raise_assert_failure"} (gdb)
-catch-exception
Command-catch-exception [ -c condition] [ -d ] [ -e exception-name ] [ -t ] [ -u ]
Add a catchpoint stopping when Ada exceptions are raised. By default, the command stops the program when any Ada exception gets raised. But it is also possible, by using some of the optional parameters described below, to create more selective catchpoints.
The possible optional parameters for this command are:
Make the catchpoint conditional on condition.
Create a disabled catchpoint.
Only stop when exception-name is raised. This option cannot be used combined with ‘-u’.
Create a temporary catchpoint.
Stop only when an unhandled exception gets raised. This option cannot be used combined with ‘-e’.
The corresponding GDB commands are ‘catch exception’ and ‘catch exception unhandled’.
-catch-exception -e Program_Error ^done,bkptno="4",bkpt={number="4",type="breakpoint",disp="keep", enabled="y",addr="0x0000000000404874", what="`Program_Error' Ada exception", thread-groups=["i1"], times="0",original-location="__gnat_debug_raise_exception"} (gdb)
Previous: Shared Library GDB/MI Catchpoint Commands, Up: GDB/MI Catchpoint Commands [Contents][Index]