debug_group(5)

DEBUG_group - Compiler options for debugging

As shipped in IRIX 6.5.7. Added in IRIX 6.5.5.

NAME
     DEBUG_group - Compiler options for debugging

IMPLEMENTATION
     IRIX systems

DESCRIPTION
     This man page describes the -DEBUG:  option to the MIPSpro compilers.
     The DEBUG option controls compiler features related to debugging; for
     example, checking for compile or runtime errors, or controlling the
     treatment of error messages.

     The DEBUG options are supported by the MIPSpro 7.3 compilers for C,
     C++, Fortran 77, and Fortran 90. For information about other compiler
     options, see the cc(1), CC(1), f77(1), or f90(1) man page.

     The following is the command line format used for the DEBUG option:

          -DEBUG:option[=value][:option2[=value2]]...

     The option is a name, which can be followed by an equal sign and a
     value.  The option names can usually be abbreviated by truncating them
     to a unique prefix. Note that if new options are added, the
     abbreviations may no longer be unique.

     Some options are specified with a setting that will enable or disable
     the feature.  To enable a feature, specify the option alone or with
     =1, =ON, or =TRUE; to disable the feature, specify the option with =0,
     =OFF, or =FALSE.  This man page only shows the ON or OFF settings, but
     the other settings are equally valid.

     A Boolean option, if used without an optional value, defaults to ON.
     In the individual descriptions which follow, the default value that is
     stated is the value if the option is not invoked at all.

   Error Detection and Reporting
     The following options are used for error detection and error
     reporting. The option names ending in _check generate runtime checking
     code; those ending in _warning generate compile-time warnings only.

     conform_check[=setting]
               Determines whether or not conformance checking is enabled.
               When set to YES, the compiler generates code to check for
               conformance of Fortran 90 array operations.  Conformance
               check failures generate run-time warnings unless the
               environment variable F90_CONFORM_CHECK_ABORT is set to YES.
               The default is OFF.

               Note that the -C, -check_bounds, and -DEBUG:subscript_check
               options all enable conformance checking.  This option is
               accepted by the MIPSpro 7 Fortran 90 compiler only.

     div_check[=n]
               Emit code to check all integer divides for zero divisors or
               overflow, using these rules for values of n:

               =0   Do no checks

               =1   Check for divide by zero

               =2   Check for overflow (for example, INT_MAX-1)

               =3   Check both divide by zero and overflow

               This option replaces -TENV:check_div.  The default is n=1.

     subscript_check[=setting]
               Generate code to check for subscripts out of range at
               runtime.  setting can be either ON or OFF.  This produces a
               trap #8 (C and C++) or an abort (FORTRAN 77) for violations
               at runtime unless -DEBUG:verbose_runtime is also specified.
               The default is setting=ON.

               This does not produce an abort for Fortran 90 or Fortran 95
               programs unless the F90_BOUNDS_CHECK_ABORT environment
               variable is set to YES.

     trap_uninitialized[=setting]
               Force all uninitialized stack, automatic and dynamically
               allocated variables to be initialized with 0xFFFA5A5A.
               setting can be ON or OFF.  When this value is used as a
               floating point variable, it is treated as a floating point
               NaN and it causes a floating point trap.  When it is used as
               a pointer, an address or segmentation violation usually
               occurs.  This option replaces -trapuv.  The default is
               setting=OFF.

     varargs_interface_check[=setting]
               Emit subprogram interface descriptors for all extern varargs
               definitions (C and C++) and calls to non-prototyped routines
               with actual parameters, and check the calls in the linker
               and rld for consistency.  The default is setting=ON.

     varargs_prototypes[=setting]
               Set vararg prototype.  ANSI C and C++ require that varargs
               routines be prototyped, and the compiler assumes this by
               default.  Failure to provide prototypes for calls to such
               routines with floating point arguments usually causes
               failures.  Turning setting to OFF eliminates these failures
               at some cost in program performance.  The compiler and/or
               linker usually produces warnings for programs which might
               encounter this problem to assist in fixing the problems.
               The default is setting=ON.

     verbose_runtime[=setting]
               Modify the behavior of various runtime checks to report
               source routine and line number of failures instead of just
               reporting trapping. This increases the code size impact of
               checking, but provides better information.  The default is
               setting=OFF.

   Message control options
     Messages are classified as follows:

     * discretionary errors, which can be turned off

     * errors, for problems which cause the compilation to fail

     * warnings, for situations which are likely to be programmer errors

     * remarks, for situations which might be problems

     By default, the compiler prints error and warning messages, but not
     remarks.  Most compiler messages have an identifying number (the
     message ID), which is printed in parentheses after the classification;
     this message ID number can be used in the options described here.

     Most error messages cannot be controlled; they are emitted, and the
     compiler rejects the file being compiled.

     The following options are used for message control.

     error=ID1[,ID2,...]
               Treat the problems reported by warnings or remarks with
               message IDs ID1, ID2, etc., as errors.

     fullwarn[=setting]
               Emit all informational messages, including remarks.  setting
               can be ON or OFF.  The default is OFF.

     remark=ID1[,ID2,...]
               Treat the problems with message IDs ID1, ID2, etc., as
               remarks (that is, do not print them unless
               -DEBUG:fullwarn=ON.  This option is not accepted by the
               MIPSpro 7 Fortran 90 compiler.

     suppress=ID1[,ID2,...]
               Suppress the messages with IDs ID1, ID2, etc. This has the
               same effect as -DEBUG:woff=.

     warning=ID1[,ID2,...]
               Treat the problems with message IDs ID1, D2, etc., as
               warnings.

     woff=ID1[,ID2,...]
               Turn off the messages with IDs ID1, ID2,...  Has the same
               effect as -DEBUG:suppress=.

   Runtime Error Reporting
     Many of the -DEBUG options support the detection of errors at runtime.
     For example, -DEBUG:subscript_check can "report" the errors either
     with a simple trap which doesn't require much code, or with a more
     expensive library call which identifies the offending routine and line
     number.  The latter choice is enabled by the -DEBUG:verbose_runtime
     option.

     The reporting routine is named __C_runtime_error.  Setting a debugger
     breakpoint at this routine is a good way to obtain further information
     about the runtime errors it reports.  However, __C_runtime_error is
     not available in libc.so in versions of Irix prior to 6.5.  A core
     dump with memory failure may occur in C or C++ programs run under
     pre-IRIX 6.5 OS versions, if the programs are compiled with
     -DEBUG:subscript_check:verbose_runtime and they encounter a subscript
     range violation.  In these cases, the programs will dump core with a
     memory failure instead of reporting the error location.

     If you provide your own dummy __C_runtime_error, you can set a
     debugger breakpoint at it to locate errors.  Furthermore, you can
     obtain a location report for this purpose by providing a routine
     similar to this example:

     ========================================================
     #include <signal.h>
     #include <stdio.h>

     void __C_runtime_error ( int trap_code, char *name, int line_no, ... )
     {
       switch ( trap_code ) {
         /* Subscript range violations: */
         case BRK_RANGE:
           fprintf ( stderr, "error: Subscript range violation", name);
           break;

         /* Others (unknown trap codes): */
         default:
           fprintf ( stderr, "error: Trap %d ", trap_code );
           break;
       }

       fprintf ( stderr, " in '%s'", name);
       if ( line_no != -1 )
         fprintf ( stderr, " (line %d)", line_no );
       fprintf ( stderr, "0 );
       exit (99);
     }
     ========================================================

SEE ALSO
     cc(1), CC(1), f77(1), f90(1)

     This man page is available only online.