Annotation of cci/usr/src/bin/cdb/ty.h, revision 1.1.1.1

1.1       root        1: /* @(#)ty.h    2.7 */
                      2: #define ityNil -1
                      3: #define cTyMax  2       /* most TY's for any one var */
                      4: 
                      5: #ifdef TAHOE
                      6: typedef struct TDS {    /* type descriptor */
                      7:         uchar   st;             /* symbol type */
                      8:         bits    fConstant : 1;  /* used in expr.c to indicate a constant */
                      9:         bits    width : 7;      /* for bit fields */
                     10:         bits    tq6 : 2;        /* type qualifiers */
                     11:         bits    tq5 : 2;
                     12:         bits    tq4 : 2;
                     13:         bits    tq3 : 2;
                     14:         bits    tq2 : 2;
                     15:         bits    tq1 : 2;
                     16:         bits    bt  : 4;        /* basic type */
                     17:         } TDR, *pTDR;
                     18: #else
                     19: #ifdef M68000
                     20: typedef struct TDS {    /* type descriptor */
                     21:         uchar   st;             /* symbol type */
                     22:         bits    fConstant : 1;  /* used in expr.c to indicate a constant */
                     23:         bits    width : 7;      /* for bit fields */
                     24:         bits    bt  : 4;        /* basic type */
                     25:         bits    tq6 : 2;        /* type qualifiers */
                     26:         bits    tq5 : 2;
                     27:         bits    tq4 : 2;
                     28:         bits    tq3 : 2;
                     29:         bits    tq2 : 2;
                     30:         bits    tq1 : 2;
                     31:         } TDR, *pTDR;
                     32: #else
                     33: typedef struct TDS {    /* type descriptor */
                     34:         uchar   st;             /* symbol type */
                     35:         bits    fConstant : 1;  /* used in expr.c to indicate a constant */
                     36:         bits    width : 7;      /* for bit fields */
                     37:         bits    bt  : 4;        /* basic type */
                     38:         bits    tq1 : 2;
                     39:         bits    tq2 : 2;
                     40:         bits    tq3 : 2;
                     41:         bits    tq4 : 2;
                     42:         bits    tq5 : 2;
                     43:         bits    tq6 : 2;        /* type qualifiers */
                     44:         } TDR, *pTDR;
                     45: #endif
                     46: #endif
                     47: #define cbTDR sizeof(TDR)
                     48: #define tdNil ((pTDR)0)
                     49: 
                     50: /* type qualifiers for TDR.tq1 -> TDR.tq6 */
                     51: #define tqNil   0
                     52: #define tqPtr   1
                     53: #define tqFunc  2
                     54: #define tqArray 3
                     55: 
                     56: /* basic types as seen in TDR.bt */
                     57: #define btNil           0
                     58: #define btFArg          1
                     59: #define btChar          2
                     60: #define btShort         3
                     61: #define btInt           4
                     62: #define btLong          5
                     63: #define btFloat         6
                     64: #define btDouble        7
                     65: #define btStruct        8
                     66: #define btUnion         9
                     67: #define btEType         10
                     68: #define btEMember       11
                     69: #define btUChar         12
                     70: #define btUShort        13
                     71: #define btUInt          14
                     72: #define btULong         15
                     73: 
                     74: typedef struct {        /* `nlist' structure */
                     75: #ifdef SYSIII
                     76:         char            sbVar[cbVarMax];
                     77: #endif
                     78: #ifdef BSD41
                     79:         long            sbVar;  /* it is actually an index into string space */
                     80: #endif
                     81:         TDR             td;     /* type descriptor */
                     82:         ulong           valTy;
                     83:         } TYR, *pTYR;
                     84: #define cbTYR sizeof(TYR)
                     85: #define tyNil ((pTYR)0)
                     86: 
                     87: /* this is the extension record that remembers structure affiliation and
                     88:  * array dimensions.  This must be carefully matched to the TYR so that
                     89:  * the 'st' field lands on the same byte.
                     90:  */
                     91: typedef struct {
                     92:         long    issRef;         /* iss of parent type */
                     93:         uchar   st;             /* if st != stExtend, don't use this record */
                     94:         char    unused;
                     95:         short   cb;
                     96:         short   rgDim[2];
                     97:         } XTYR, *pXTYR;
                     98: #define cbXTYR sizeof(XTYR)
                     99: #define xtyNil ((pXTYR)0)
                    100: 
                    101: #ifdef BSD42
                    102: typedef struct {   /* alternate form of BSD symbol for getting at dbx info */
                    103:         long            sbVar;  /* same as TYR */
                    104:         uchar           st;     /* same meaning as TYR */
                    105:         char            other;
                    106:         short           size;   /* for dbx, this is the size in bytes */
                    107:         ulong           valTy;  /* for variables - same as TYR */
                    108:         } DBTYR, *pDBTYR;
                    109: #define cdDBTYR sizeof(DBTYR)
                    110: #define dbtyNil ((pDBTYR)0)
                    111: #endif
                    112: 
                    113: /* these are defined for each system in sym.h
                    114:  * these are the Berkeley definitions
                    115:  * #define N_UNDF       0x0
                    116:  * #define N_ABS        0x2
                    117:  * #define N_TEXT       0x4
                    118:  * #define N_DATA       0x6
                    119:  * #define N_BSS        0x8
                    120:  */
                    121: 
                    122: /* values for st.
                    123:  * be very careful about using 4, 6, or 8 as last number in ST !!!
                    124:  * they are known to the Berkeley loader as specifying text, data and bss space
                    125:  */
                    126: #define stPascal 0x30   /* global pascal symbol: name,,0,subtype,line */
                    127: #define stGlobal 0x20   /* global symbol: name,,0,type,0 */
                    128: #define stFName 0x22    /* procedure name (f77 kludge): name,,0 */
                    129: #define stProc  0x24    /* procedure: name,,0,linenumber,address */
                    130: #define stStatic 0x26   /* static symbol: name,,0,type,address */
                    131: #define stLComm 0x28    /* .lcomm symbol: name,,0,type,address */
                    132: #define stReg   0x40    /* register symbol: name,,0,type,register */
                    133: #define stLine  0x44    /* source line: 0,,0,linenumber,address */
                    134: #define stStruct 0x60   /* struct element: name,,w,type,struct_offset (bytes) */
                    135: /* In the preceding, `w' is the width, specified only for bit fields */
                    136: /* If w != 0, then offset is in BITS */
                    137: #define stSource 0x64   /* source file name: name,,0,0,address */
                    138: #define stLocal 0x80    /* local symbol: name,,0,type,offset */
                    139: #define stInclude 0x84  /* #include file name: name,,0,0,address */
                    140: #define stParam 0xa0    /* parameter: name,,0,type,offset */
                    141: #define stEntry 0xa4    /* alternate entry: name,,0,linenumber,address */
                    142: #define stLBrac 0xc0    /* left bracket: 0,,0,nesting level, address*/
                    143: #define stRBrac 0xe0    /* right bracket: 0,,0,nesting level, address*/
                    144: #define stBComm 0xe2    /* begin common: name,, */
                    145: #define stEComm 0xe4    /* end common: name,, */
                    146: #define stELocal 0xe8   /* end common (local name): ,,address */
                    147: #define stExtend 0xf7   /* cdb: this is a second stab. shape is XTYR, not TYR */
                    148: #define stSpc   0xfa    /* cdb: special variable - lives in cdb, not child */
                    149: #define stPure  0xfb    /* cdb: this is PURE type info (struct, union, enum) */
                    150:                         /* dbx uses .lcomm instead */
                    151: #define stValue 0xfc    /* cdb: value field is VALUE, used in expr evaluation */
                    152: #define stLeng  0xfe    /* second stab entry with length information */
                    153: 
                    154: #ifdef BSD41
                    155: /* the following are used by the BSD pascal compiler for global symbols.
                    156:  * they live in the td.bt field of a TYR
                    157:  */
                    158: #define ptSource        1    /* source file name */
                    159: #define ptInclude       2    /* included file name */
                    160: #define ptLabel         3    /* global label */
                    161: #define ptConstant      4    /* global constant */
                    162: #define ptType          5    /* global type */
                    163: #define ptVar           6    /* global variable */
                    164: #define ptFunc          7    /* global function */
                    165: #define ptProc          8    /* global procedure */
                    166: #define ptExtFunc       9    /* external function */
                    167: #define ptExtProc       10   /* external procedure */
                    168: #define ptLibVar        11   /* library variable */
                    169: #define ptLibProc       12   /* library routine */
                    170: #endif

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.