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