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:
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:
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)
-catch-handlers
Command-catch-handlers [ -c condition] [ -d ] [ -e exception-name ] [ -t ]
Add a catchpoint stopping when Ada exceptions are handled. By default, the command stops the program when any Ada exception gets handled. 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:
The corresponding gdb command is ‘catch handlers’.
-catch-handlers -e Constraint_Error ^done,bkptno="4",bkpt={number="4",type="breakpoint",disp="keep", enabled="y",addr="0x0000000000402f68", what="`Constraint_Error' Ada exception handlers",thread-groups=["i1"], times="0",original-location="__gnat_begin_handler"} (gdb)