Blob


1 stabs
3 N_MAIN with name "main" to identify entry function
4 N_SO source file. might be preceded by dir ending in /
5 value is code ptr
6 empty string means source done
7 N_SOL source include file, value = text addr of where this starts
8 N_SLINE start of source line
9 no name
10 desc = line number
11 value = code addr for that line
13 N_FUN (36) function def
14 'F' global 'f' local
15 value = addr
16 desc = line number of def
17 return type is number after :
19 nil name marks end of function
21 constants
23 c= XXX p. 15
25 N_LSYM (128) local variable
26 :type-number
27 value = offset from fp
28 :ptype means parameter passed in reg but stored as variable
30 N_GSYM (32) global variable
31 addr not given (use external symbol)
32 :type
34 N_RSYM register value
36 N_STSYM(38)/N_FUN/N_LCSYM(40) data/text/bss
37 static varibale 'S' file static 'V' procedure static
38 :Stype :Vtype
40 N_PSYM (160) parameter
41 :ptype
42 value=offset from fp
43 desc = line number of decl
45 register params followed by an N_RSYM with same name and :rtype.
47 skip types
49 type (a,b) means a=file number b=type number
51 N_BINCL/N_EINCL begin/end include
52 N_EXCL - same effect as earlier guy
56 =============
58 type crap
62 name:symbol_opt typeinfo
64 typeinfo ::= typenum | typenum = attr* typedef
66 typenum ::= integer | '(' integer ',' integer ')'
68 attr ::= @ attrtext ;
70 attrtext ::= 'a' integer (alignment)
71 | 'p' integer (pointer class)
72 | 'P' (packed type)
73 | 's' integer (size of type in bits)
74 | 'S' (string instead of array of chars)
76 typedef ::= typeinfo
77 | 'b' ('u' | 's') 'c'? width; offset; nbits; (builtin, signed/unsigned, char/not, width in bytes, offset & nbits of type)
78 | 'w' (aix wide char type, not used)
79 | 'R' fptype; bytes; (fptype 1=32-bit, 2=64-bit, 3=complex, 4=complex16, 5=complex32, 6=long double)
80 | 'g' typeinfo ';' nbits (aix floating, not used)
81 | 'c' typeinfo ';' nbits (aix complex, not used)
82 | -1 int32
83 | -2 char8
84 | -3 int16
85 | -4 int32 (long)
86 | -5 uchar8
87 | -6 schar8
88 | -7 uint16
89 | -8 uint32
90 | -9 uint32
91 | -10 ulong32
92 | -11 void
93 | -12 float
94 | -13 double
95 | -14 long double
96 | -15 int32
97 | -16 bool32
98 | -17 short real
99 | -18 real
100 | -19 stringptr
101 | -20 character8
102 | -21 logical*1 8
103 | -22 logical*2 16
104 | -23 logical*4 32
105 | -24 logical 32
106 | -25 complex (two single)
107 | -26 complex (two double)
108 | -27 integer*1 8 signed
109 | -28 integer*2 16 signed
110 | -29 integer*4 32 signed
111 | -30 wchar 16 wide char
112 | -31 int64
113 | -32 uint64
114 | -33 logical*8 64
115 | -34 integer*8 64 signed
116 | 'b' typeinfo ';' bytes (ibm, no idea)
117 | 'B' typeinfo (volatile typref)
118 | 'd' typeinfo (file of typeref)
119 | 'k' typeinfo (const typeref)
120 | 'M' typeinfo ';' length (multiple instance type, fortran)
121 | 'S' typeinfo (set, typeref must have small number of values)
122 | '*' typeinfo (pointer to typeref)
123 | 'x' ('s'|'u'|'e') name ':' (struct, union, enum reference. name can have '::' in it)
124 | 'r' typeinfo ';' low ';' high ';' (subrange. typeref can be type being defined for base types!)
125 low and high are bounds
126 if bound is octal power of two, it's a big negative number
127 | ('a'|'P') indextypedef arraytypeinfo (array, index should be range type)
128 indextype is type definition not typeinfo (need not say typenum=)
129 P means packed array
130 | 'A' arraytypeinfo (open array (no index bounds))
131 | 'D' dims ';' typeinfo (dims-dimensional dynamic array)
132 | 'E' dims ';' typeinfo (subarray of N-dimensional array)
133 | 'n' typeinfo ';' bytes (max length string)
134 | 'z' typeinfo ';' bytes (no idea what difference is from 'n')
135 | 'N' (pascal stringptr)
136 | 'e' (name ':' bigint ',')* ';' (enum listing)
137 | ('s'|'u') bytes (name ':' type ',' bitoffset ',' bitsize ';')* ';' (struct/union defn)
138 tag is given as name in stabs entry, with 'T' symbol
139 | 'f' typeinfo ';' (function returning type)
140 | 'f' rettypeinfo ',' paramcount ';' (typeinfo ',' (0|1) ';')* ';'
141 | 'p' paramcount ';' (typeinfo ',' (0|1) ';')* ';'
142 | 'F' rettypeinfo ',' paramcount ';' (name ':' typeinfo ',' (0|1) ';')* ';'
143 | 'R' paramcount ';' (name ':' typeinfo ',' (0|1) ';')* ';'
144 (the 0 or 1 is pass-by-reference vs pass-by-value)
145 (the 0 or 1 is pass-by-reference vs pass-by-value)
147 bound ::=
148 'A' offset (bound is on stack by ref at offset offset from arg list)
149 | 'T' offset (bound is on stack by val at offset offset from arg list)
150 | 'a' regnum (bound passed by reference in register)
151 | 't' regnum (bound passed by value in register)
152 | 'J' (no bound)
153 | bigint
155 bigint ::= '-'? decimal
156 | 0 octal
157 | -1
159 C++
161 symbol 'Tt' means typename + tag in one stab
163 names can have ::, as in foo::bar::baz::t1
165 t16 unknown type just like void
166 t17 vtable record type