Compiling with the debug option -g

PureCoverage adds an instruction sequence for each function to record the number of times the function is entered. (The exact location of the instruction sequence, at or near the entry point of the function, depends on your compiler.) PureCoverage always provides the same summary information for the functions in your program, as well as for the files and directories, regardless of which compilation options you use.

When you compile code using the -g debug option, the compiler includes debugging information in the resulting object file, relating source line numbers to the program instructions. In this case, PureCoverage adds a count sequence at the beginning of each basic block of code.

A basic block is an indivisible sequence of instructions always executed together in succession. PureCoverage uses this information to generate an annotated source listing that shows the lines that are tested and untested within a function.

If you compile code without the -g option, PureCoverage does not provide coverage data below the function level. It cannot annotate source code with line coverage data because there is no way to tell which program instructions relate to which lines. Although you can display summary information for this code in the Viewer, you cannot open the Annotated Source window for it.

Do not use PureCoverage to instrument files that were compiled with both -g and -O at the same time. The -O option changes instruction ordering, so that data for line counts can be misleading.