Instrumentation pragmas for Ada language

You can add special directives to the source code under test, known as instrumentation pragma directives, to modify the behavior of the source analyzer or to give specific directives to the different features such as coverage, trace, memory profiling, and performance analysis.

Usage

Following are the two kinds of pragmas for Ada language:
--#pragma attol <pragma name> <directive>
--!attol!-- <code>

The first syntax is similar to the one used in C/C++ languages.

The second syntax is specific to Ada language. It can be used to add code that is analyzed by the instrumenter.

Instrumentation pragma names

--#pragma attol stop_analyze 
--#pragma attol start_analyze

These pragmas can be used to start and stop the source code analysis. By default, the source code analysis is set. If a syntax is not supported, it could be ignored by surrounding it with stop_analyze and then start_analyze.

Instrumentation specific code

--!attol!-- <code> 

You can include code that will only undergo analysis by the instrumenter. The analysis extends until the end of the line containing the code.

This is useful when an Ada syntax is not supported by the instrumenter in combination with the pragmas stop_analyzeand start_analyze. If you stop the analysis of some declarations, the rest of the code might generate syntax errors. This directive can be used to introduce alternate declarations to the instrumenter, that enables the instrumenter to continue the analysis without errors.

Example:

package ptest5 is
    type mytype is new integer;
--# pragma attol stop_analyze
    myvar : mytype with Linker_Section => ".mysec";  
-- this line is ignored by the parser but used by the compiler
--# pragma attol start_analyze
--!ATTOL!--    myvar : mytype;       
-- this line is analysed by the parser but not by the compiler
    myvar2 : mytype;
    pragma Linker_Section (myvar2 , ".mysec");
    Function myfunc (para : out mytype) return Boolean;
end ptest5;