Open64 (mfef90, whirl2f, and IR tools)  TAG: version-openad; SVN changeset: 916
config_debug.h
Go to the documentation of this file.
00001 /*
00002 
00003   Copyright (C) 2000, 2001 Silicon Graphics, Inc.  All Rights Reserved.
00004 
00005   This program is free software; you can redistribute it and/or modify it
00006   under the terms of version 2 of the GNU General Public License as
00007   published by the Free Software Foundation.
00008 
00009   This program is distributed in the hope that it would be useful, but
00010   WITHOUT ANY WARRANTY; without even the implied warranty of
00011   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
00012 
00013   Further, this software is distributed without any warranty that it is
00014   free of the rightful claim of any third person regarding infringement 
00015   or the like.  Any license provided herein, whether implied or 
00016   otherwise, applies only to this software file.  Patent licenses, if 
00017   any, provided herein do not apply to combinations of this program with 
00018   other software, or any other product whatsoever.  
00019 
00020   You should have received a copy of the GNU General Public License along
00021   with this program; if not, write the Free Software Foundation, Inc., 59
00022   Temple Place - Suite 330, Boston MA 02111-1307, USA.
00023 
00024   Contact information:  Silicon Graphics, Inc., 1600 Amphitheatre Pky,
00025   Mountain View, CA 94043, or:
00026 
00027   http://www.sgi.com
00028 
00029   For further information regarding this notice, see:
00030 
00031   http://oss.sgi.com/projects/GenInfo/NoticeExplan
00032 
00033 */
00034 
00035 
00036 /* ====================================================================
00037  * ====================================================================
00038  *
00039  *
00040  * Revision history:
00041  *  02-Nov-96 - Original Version
00042  *
00043  * Description:
00044  *
00045  * Define the external interface to the internal flags representing the
00046  * -DEBUG group options.  It is a single struct, so that addition of
00047  * flags for new options does not require additions to the be Exported
00048  * file, and so that push/pop operations are simplified.
00049  *
00050  * NOTE:  Only the standard group option reader, and routines in the
00051  * associated file config_debug.c, should modify the structs declared
00052  * here.  By following this discipline, leaving a few undefined flags
00053  * at the end of the struct, and adding new flags there, we can avoid 
00054  * serious version incompatibilities between be.so and its clients.
00055  *
00056  * ====================================================================
00057  *
00058  * To add a new option:
00059  *
00060  *   1) In the DEBUG_FLAGS options struct defined below, add a field to
00061  *      receive the new option value.  If you need a flag indicating
00062  *      whether the option was set explicitly on the command line, add
00063  *      a BOOL for that as well, with an appended "_set" in its name.
00064  *      (You might also need another field if the option will be used
00065  *      in a different form after configuration, i.e. the option value
00066  *      is a string that is converted to a number.  If so, add another
00067  *      field.)
00068  *
00069  *      The fields are starting out in alphabetical order by option
00070  *      name.  When adding new ones, keep in mind that adding them in
00071  *      the middle will create a required sychronization between the
00072  *      new be.so and other be components (for purposes of using the
00073  *      later options).  That may be alright, but if you want to avoid
00074  *      it, add the new fields just before the buffer at the end (and
00075  *      you can move them into place later when the synchronization is
00076  *      tolerable, if you care).
00077  *
00078  *   2) Below the DEBUG_FLAGS definition are #defines for the
00079  *      "DEBUG_Option_Name" pseudo-variables that everyone will use to
00080  *      reference them.  Add #defines for your new ones.  Note that
00081  *      they all have DEBUG_ prefixes and are capitalized like global
00082  *      variables.
00083  *
00084  *   3) There are two static instances of DEBUG_FLAGS in config_debug.c.
00085  *      Default_DEBUG contains default values to be used when
00086  *      initializing new structs (when we implement pushing/popping
00087  *      for regions), and Initial_DEBUG contains the initial defaults.
00088  *      Add the correct default values for your options there.
00089  *
00090  *   4) The option group descriptor is also in config_debug.c.  Add
00091  *      your new option there.  Note that the option descriptors are
00092  *      specified using a small set of macros defined above the
00093  *      descriptor.
00094  *
00095  *   5) If any configuration is required after reading them in, add the
00096  *      required code to DEBUG_Configure in config_debug.c.
00097  *
00098  * NOTE:  It is NOT necessary to add anything to the be Exported list.
00099  *
00100  * ====================================================================
00101  * ====================================================================
00102  */
00103 
00104 #ifndef config_debug_INCLUDED
00105 #define config_debug_INCLUDED
00106 
00107 #ifdef _KEEP_RCS_ID
00108 /*REFERENCED*/
00109 #endif /* _KEEP_RCS_ID */
00110 
00111 #ifdef __cplusplus
00112 extern "C" {
00113 #endif /* __cplusplus */
00114 
00115 struct skiplist;
00116 struct option_list;
00117 
00118 /* ====================================================================
00119  *
00120  * -DEBUG: option group
00121  *
00122  * Define the global structure containing -DEBUG option group flags.
00123  *
00124  * WARNING:  Most of the fields in this struct must be addressable by
00125  * an option group descriptor -- hence BOOL instead of mBOOL.
00126  *
00127  * ====================================================================
00128  */
00129 
00130 typedef struct debug_flags {
00131   /* Support a stack of structs, e.g. for region support.
00132    * Each stack element points to its predecessor; the bottom to NIL.
00133    */
00134   struct debug_flags *next;     /* Next copy on stack */
00135 
00136   BOOL cmod_warn;               /* Storing values in const variables */
00137   BOOL cmod_warn_set;           /* ... option explicitly set ... */
00138   BOOL cray_port;               /* Enable all Cray porting options */
00139   BOOL cray_port_set;           /* ... option explicitly set ... */
00140   INT32 div_check;              /* Integer division by zero, overflow */
00141   BOOL div_check_set;           /* ... option explicitly set ... */
00142   BOOL equiv_warn;              /* Data size changes affect EQUIVALENCE */
00143   BOOL equiv_warn_set;          /* ... option explicitly set ... */
00144   struct option_list *error;    /* Warnings to treat as errors */
00145   BOOL error_set;               /* ... option explicitly set ... */
00146   BOOL fullwarn;                /* Emit all warning messages */
00147   BOOL fullwarn_set;            /* ... option explicitly set ... */
00148   BOOL full_iface_check;        /* Check all call interfaces */
00149   BOOL full_iface_check_set;    /* ... option explicitly set ... */
00150   BOOL i32_oflow_check;         /* 32-bit integer overflow checks */
00151   BOOL i32_oflow_check_set;     /* ... option explicitly set ... */
00152   BOOL int_oflow_check;         /* all integer overflow checks */
00153   BOOL int_oflow_check_set;     /* ... option explicitly set ... */
00154   BOOL optimize_space;          /* optimize space in debug info */
00155   BOOL optimize_space_set;      /* ... option explicitly set ... */
00156   BOOL parm_alias_check;        /* Fortran parameter aliasing violations */
00157   BOOL parm_alias_check_set;    /* ... option explicitly set ... */
00158   BOOL ptr_incr_warn;           /* Fortran ptr increments by odd amounts */
00159   BOOL ptr_incr_warn_set;       /* ... option explicitly set ... */
00160   BOOL printf_warn;             /* printf formats don't match arg sizes */
00161   BOOL printf_warn_set;         /* ... option explicitly set ... */
00162   struct option_list *remark;   /* Warnings/errors to treat as remarks */
00163   BOOL remark_set;              /* ... option explicitly set ... */
00164   BOOL shift_check;             /* Shift counts larger than object size */
00165   BOOL shift_check_set;         /* ... option explicitly set ... */
00166   BOOL shift_warn;              /* Shift counts larger than object size */
00167   BOOL shift_warn_set;          /* ... option explicitly set ... */
00168   BOOL subscript_check;         /* Subscripting out of range */
00169   BOOL subscript_check_set;     /* ... option explicitly set ... */
00170   BOOL trap_uv;                 /* Enable init of local uninitialized vars */
00171   BOOL trap_uv_set;             /* ... option explicitly set ... */
00172   BOOL trap_uv_rjustify;        /* Right justify init of uninitialized vars */
00173   BOOL trap_uv_rjustify_set;    /* ... option explicitly set ... */
00174   BOOL trunc_check;             /* 64- to 32-bit assignments */
00175   BOOL trunc_check_set;         /* ... option explicitly set ... */
00176   BOOL trunc_warn;              /* 64- to 32-bit assignments */
00177   BOOL trunc_warn_set;          /* ... option explicitly set ... */
00178   BOOL varargs_iface_check;     /* Check varargs call interfaces */
00179   BOOL varargs_iface_check_set; /* ... option explicitly set ... */
00180   BOOL varargs_prototypes;      /* Don't require varargs prototypes */
00181   BOOL varargs_prototypes_set;  /* ... option explicitly set ... */
00182   BOOL verbose_runtime;         /* Verbose runtime error reporting */
00183   BOOL verbose_runtime_set;     /* ... option explicitly set ... */
00184   struct option_list *warning;  /* Warnings/errors to treat as warnings */
00185   BOOL warning_set;             /* ... option explicitly set ... */
00186   struct option_list *woff;     /* Explicitly suppressed warnings */
00187   BOOL woff_set;                /* ... option explicitly set ... */
00188   BOOL ir_version_check;        /* check whether IR is of matching version */
00189   INT32 alignment;              /* controls generation of ldl/ldr */
00190   BOOL ipalno_version_check;    /* check whether IPALNO file is of matching 
00191                                    version */ 
00192   BOOL conform_check;           /* F90 Conformance check */
00193   BOOL conform_check_set;       /* ... option explicitly set ... */
00194 
00195   /* This buffer area allows references to new fields to be added in
00196    * later revisions, from other DSOs, without requiring a new be.so
00197    * or running the risk of referencing illegal data.  Assuming that
00198    * the buffer is initialized to zeroes, any such references will
00199    * simply pick up FALSE values (for the Booleans):
00200    */
00201   INT32 buffer[16];             /* Buffer space -- initialize to FALSE */
00202 } DEBUG_FLAGS;
00203 
00204 /* ====================================================================
00205  *
00206  * -DEBUG: option group
00207  *
00208  * Global data objects and manipulation functions.
00209  *
00210  * ====================================================================
00211  */
00212 
00213 /* This is always the current top of stack: */
00214 extern DEBUG_FLAGS *Current_DEBUG;
00215 
00216 /* And this is always the invariant bottom of stack: */
00217 extern DEBUG_FLAGS Initial_DEBUG;
00218 
00219 /* Values for div_check option -- independent bits (3 => both): */
00220 #define DIV_ZERO_CHECK  1       /* Divide-by-zero check */
00221 #define DIV_OFLOW_CHECK 2       /* Divide overflow (MAX/-1) check */
00222 #define DEFAULT_DIV_CHECK       DIV_ZERO_CHECK
00223 
00224 /* Values for generation of ld/st alignment */
00225 #define ALIGN_NORMAL    0       /* generate ldl/ldr as needed   */
00226 #define ALIGN_FIXADE    1       /* kernel will fix unaligned memory instruction */
00227 #define ALIGN_COMPOSE   2       /* compile generated instructions for non-aligned data */
00228 #define DEFAULT_ALIGN   ALIGN_NORMAL
00229 
00230 /* Access to the current TOS struct is via pseudo-global variables: */
00231 /* bounds_check same as subscript_check */
00232 #define DEBUG_Const_Mod_Warning         (Current_DEBUG->cmod_warn)
00233 #define DEBUG_Const_Mod_Warning_Set     (Current_DEBUG->cmod_warn_set)
00234 #define DEBUG_Cray_Port                 (Current_DEBUG->cray_port)
00235 #define DEBUG_Cray_Port_Set             (Current_DEBUG->cray_port_set)
00236 #define DEBUG_Div_Check                 (Current_DEBUG->div_check)
00237 #define DEBUG_Div_Check_Set             (Current_DEBUG->div_check_set)
00238 # define DEBUG_Div_Zero_Check   (Current_DEBUG->div_check & DIV_ZERO_CHECK)
00239 # define DEBUG_Div_Oflow_Check  (Current_DEBUG->div_check & DIV_OFLOW_CHECK)
00240 #define DEBUG_Equiv_Warning             (Current_DEBUG->equiv_warn)
00241 #define DEBUG_Equiv_Warning_Set         (Current_DEBUG->equiv_warn_set)
00242 /* error=... not externally visible */
00243 #define DEBUG_Fullwarn                  (Current_DEBUG->fullwarn)
00244 #define DEBUG_Fullwarn_Set              (Current_DEBUG->fullwarn_set)
00245 #define DEBUG_Full_Interface_Check      (Current_DEBUG->full_iface_check)
00246 #define DEBUG_Full_Interface_Check_Set  (Current_DEBUG->full_iface_check_set)
00247 #define DEBUG_Int32_Overflow_Check      (Current_DEBUG->i32_oflow_check)
00248 #define DEBUG_Int32_Overflow_Check_Set  (Current_DEBUG->i32_oflow_check_set)
00249 #define DEBUG_Int_Overflow_Check        (Current_DEBUG->int_oflow_check)
00250 #define DEBUG_Int_Overflow_Check_Set    (Current_DEBUG->int_oflow_check_set)
00251 #define DEBUG_Optimize_Space            (Current_DEBUG->optimize_space)
00252 #define DEBUG_Parameter_Alias_Check     (Current_DEBUG->parm_alias_check)
00253 #define DEBUG_Parameter_Alias_Check_Set (Current_DEBUG->parm_alias_check_set)
00254 #define DEBUG_Pointer_Increment_Warning (Current_DEBUG->ptr_incr_warn)
00255 #define DEBUG_Pointer_Increment_Warning_Set (Current_DEBUG->ptr_incr_warn_set)
00256 #define DEBUG_Printf_Warning            (Current_DEBUG->printf_warn)
00257 #define DEBUG_Printf_Warning_Set        (Current_DEBUG->printf_warn_set)
00258 /* remark=... not externally visible */
00259 #define DEBUG_Shift_Check               (Current_DEBUG->shift_check)
00260 #define DEBUG_Shift_Check_Set           (Current_DEBUG->shift_check_set)
00261 #define DEBUG_Shift_Warning             (Current_DEBUG->shift_warn)
00262 #define DEBUG_Shift_Warning_Set         (Current_DEBUG->shift_warn_set)
00263 #define DEBUG_Subscript_Check           (Current_DEBUG->subscript_check)
00264 #define DEBUG_Subscript_Check_Set       (Current_DEBUG->subscript_check_set)
00265 #define DEBUG_Trap_Uv                   (Current_DEBUG->trap_uv)
00266 #define DEBUG_Trap_Uv_Set               (Current_DEBUG->trap_uv_set)
00267 #define DEBUG_Trap_Uv_Rjustify          (Current_DEBUG->trap_uv_rjustify)
00268 #define DEBUG_Trap_Uv_Rjustify_Set      (Current_DEBUG->trap_uv_rjustify_set)
00269 #define DEBUG_Trunc_Check               (Current_DEBUG->trunc_check)
00270 #define DEBUG_Trunc_Check_Set           (Current_DEBUG->trunc_check_set)
00271 #define DEBUG_Trunc_Warning             (Current_DEBUG->trunc_warn)
00272 #define DEBUG_Trunc_Warning_Set         (Current_DEBUG->trunc_warn_set)
00273 #define DEBUG_Varargs_Interface_Check   (Current_DEBUG->varargs_iface_check)
00274 #define DEBUG_Varargs_Interface_Check_Set (Current_DEBUG->varargs_iface_check_set)
00275 #define DEBUG_Varargs_Prototypes        (Current_DEBUG->varargs_prototypes)
00276 #define DEBUG_Varargs_Prototypes_Set    (Current_DEBUG->varargs_prototypes_set)
00277 #define DEBUG_Verbose_Runtime           (Current_DEBUG->verbose_runtime)
00278 #define DEBUG_Verbose_Runtime_Set       (Current_DEBUG->verbose_runtime_set)
00279 /* warning=... not externally visible */
00280 /* woff=...:suppress=... not externally visible */
00281 #define DEBUG_Ir_Version_Check          (Current_DEBUG->ir_version_check)
00282 #define DEBUG_IPALNO_Version_Check      (Current_DEBUG->ipalno_version_check)
00283 
00284 #define DEBUG_Alignment                 (Current_DEBUG->alignment)
00285 #define DEBUG_Alignment_Normal          (Current_DEBUG->alignment==ALIGN_NORMAL)
00286 #define DEBUG_Alignment_Fixade          (Current_DEBUG->alignment==ALIGN_FIXADE)
00287 #define DEBUG_Alignment_Compose         (Current_DEBUG->alignment==ALIGN_COMPOSE)
00288 #define DEBUG_Conform_Check             (Current_DEBUG->conform_check)
00289 #define DEBUG_Conform_Check_Set         (Current_DEBUG->conform_check_set)
00290 
00291 /* Initialize the current top of stack to defaults: */
00292 extern void DEBUG_Init_Config ( void );
00293 
00294 /* Push a new struct on top of stack, either a copy of the current
00295  * TOS, or the defaults:
00296  */
00297 extern void DEBUG_Push_Config ( BOOL use_default );
00298 
00299 /* Pop a struct from top of stack and return TRUE if the old TOS was
00300  * not the original TOS, or do nothing and return FALSE:
00301  */
00302 extern BOOL DEBUG_Pop_Config ( void );
00303 
00304 /* Configure the current top of stack struct: */
00305 extern void DEBUG_Configure ( void );
00306 
00307 
00308 #ifdef __cplusplus
00309 }
00310 #endif /* __cplusplus */
00311     
00312 #endif /* config_debug_INCLUDED */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines