Next: , Previous: Additions to Ada, Up: Ada


12.4.3.4 Stopping at the Beginning

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
Does the equivalent of setting a temporary breakpoint at the beginning of the main procedure and then performing 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.