Technical data
Cray Standard C/C++ Reference Manual
• Edit values of variables and memory locations
• Evaluate code fragments
8.2 Compiler Debugging Options
To use the Cray TotalView debugger in debugging your code, you must first
compile your code using one of the debugging options (-g or -G). These options
are specified as follows:
• -Gf
If you specify the -Gf debugging option, the Cray TotalView debugger allows
you to set breakpoints at function entry and exit and at labels.
• -Gp
If you specify the -Gp debugging option, the Cray TotalView debugger
allows you to set breakpoints at function entry and exit, labels, and at places
where execution control flow changes (for example, loops, switch, and
if...else statements).
• -Gn or -g
If you specify the -Gn or -g debugging option, the Cray TotalView debugger
allows you to set breakpoints at function entry and exit, labels, and executable
statements. These options force all compiler optimizations to be disabled as
if you had specified -O0.
Users of the Cray Standard C/C++ compilers do not have to sacrifice runtime
performance to debug codes. Many compiler optimizations are inhibited by
breakpoints generated for debugging. By specifying a higher debugging level,
fewer breakpoints are generated and better optimization occurs.
However, consider the following cases in which optimization is affected by
the -Gp and -Gf debugging options:
• Vectorization can be inhibited if a label exists within the vectorizable loop.
• Vectorization can be inhibited if the loop contains a nested block and the -Gp
option is specified.
• When the -Gp option is specified, setting a breakpoint at the first statement
in a vectorized loop allows you to stop and display at each vector iteration.
However, setting a breakpoint at the first statement in an unrolled loop may
not allow you to stop at each vector iteration.
122 S–2179–36










