Next: Ada Exceptions, Previous: Additions to Ada, Up: Ada
The main procedure in Ada has no fixed name, and attempts to break on
main
will position you to an utterly unhelpful location, in general.
Therefore, Ada mode provides a convenient way to begin execution of the
program and to stop at the beginning.
begin
run
. Since in general there is
package elaboration code that runs before the main procedure begins, it is
possible that the program will stop before reaching the main procedure.
However, the temporary breakpoint will remain to halt execution.
It is sometimes necessary to debug the program during elaboration.
In these cases, using the begin
command would stop the
execution of your program too late, as the program would have already
completed the elaboration phase. As defined in the Ada Reference
Manual, the elaboration code is invoked from a procedure called
adainit
. To start your program until the beginning of the
elaboration, simply use the following two commands:
tbreak adainit
and run
.