Debug Options
Topic details the different options available for debugging.
-G debug_lvl, -g
Enable the generation of debugging information used by symbolic debuggers. Allow debugging with breakpoints. Better debugging information comes at the cost of inhibiting certain optimization techniques, so choose the debug_lvl that best fits the debugging needs of any particular source file in an application.
The -g option is equivalent to -G0. The -g option is included for compatibility with earlier versions of the compiler and many other UNIX systems; the -G option is the preferred specification.
These options recognize OpenMP directives and disable all optimizations. They imply -hthread1 -homp -hfp0. The debugging options take precedence over any conflicting options that appear on the command line. If more than one debugging option appears, the last one specified overrides the others.
The -g or -G options can be specified on a per-file basis, so that only part of an application pays the price for improved debugging.
| debug_lvl | Optimization | Breakpoints Allowed On | Debugging | Execution Speed |
|---|---|---|---|---|
| 0 | None | Every executable statement | Best | Limited |
| 1 | Partial | Block boundaries | Medium | Medium |
| 2 | Full | Function entry and exit | Limited | Best |
| fast | Full | Every executable statement | Requires fast-track debugger | Best |
-h [no]bounds (cc)
Default: -h nobounds
-h bounds provides checking of pointer and array references to ensure that they are within acceptable boundaries. -h nobounds disables these checks. For each dimension, the checks verify that the subscript is greater than or equal to 0 and less than the upper bound. For pointers, the upper bound is computed based on the amount of the memory on the node. This amount is scaled at runtime by the number of UPC threads in the job for UPC pointers-to-shared with definite blocksize. For arrays, the declared (possibly implicit) upper bound of the dimension is used. If the dimension is the THREADS-scaled dimension of a UPC shared array with definite blocksize, the upper bound for the check is computed at runtime based on the number of UPC threads in the job.
-h develop
Default: off
Reduce compile time at the expense of optimization. This option is intended to be used when a program is under development and compiled frequently. This option is different from and independent of the -O option. For example, -O0 disables all optimizations, but sometimes can increase compile time because certain optimizations reduce code size, which allow other phases of the compiler to deal with less code.
-h dir_check
Default: off
Enables directive checking at run time. Errors detected at compile time are reported during compilation and so are not reported at run time. The following directives are checked: collapse, and the loop_info clauses min_trips and max_trips. Violation of a run time check results in an immediate fatal error diagnostic.
Optimization of enclosing and adjacent loops is degraded when run time directive checking is enabled. This capability, though useful for debugging, is not recommended for production runs.
-h gasp[=opt[:opt]]
Default: disabled
Request GASP (Global Address Space Performance Analysis) instrumentation. Requests instrumentation of events generated by shared local accesses. Instrumenting these events can add runtime overhead to the application.
#pragma pupc [on|off] has no effect in the current GASP implementation.
- local
- Requests instrumentation of events generated by shared local accesses. Instrumenting these events can add runtime overhead to the application
- functions
- Enables function instrumentation. Sets -hipa0
-h nodwarf
Disables DWARF generation during compilation. By default, DWARF source line information is generated to support traceback analysis. -hdwarf is deprecated. This option has no affect if -g or -G is specified.
-h zero
Default: disabled
Cause stack-allocated memory to be initialized to all zeros.