1267194Sray/* Table of DBX symbol codes for the GNU system.
2267194Sray   Copyright 1988, 1991, 1992, 1993, 1994, 1996, 1998, 2004
3267194Sray   Free Software Foundation, Inc.
4267194Sray
5267194Sray   This program is free software; you can redistribute it and/or
6267194Sray   modify it under the terms of the GNU General Public License as
7267194Sray   published by the Free Software Foundation; either version 2 of the
8267194Sray   License, or (at your option) any later version.
9267194Sray
10267194Sray   This program is distributed in the hope that it will be useful,
11267194Sray   but WITHOUT ANY WARRANTY; without even the implied warranty of
12267194Sray   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13267194Sray   GNU General Public License for more details.
14267194Sray
15267194Sray   You should have received a copy of the GNU General Public License
16267194Sray   along with this program; if not, write to the Free Software
17267194Sray   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
18293047Semaste
19267194Sray/* New stab from Solaris 2.  This uses an n_type of 0, which in a.out files
20267194Sray   overlaps the N_UNDF used for ordinary symbols.  In ELF files, the
21267194Sray   debug information is in a different file section, so there is no conflict.
22270114Sse   This symbol's n_value gives the size of the string section associated
23270114Sse   with this file.  The symbol's n_strx (relative to the just-updated
24270114Sse   string section start address) gives the name of the source file,
25270114Sse   e.g. "foo.c", without any path information.  The symbol's n_desc gives
26270114Sse   the count of upcoming symbols associated with this file (not including
27270114Sse   this one).  */
28270114Sse/* __define_stab (N_UNDF, 0x00, "UNDF")  */
29270114Sse
30270114Sse/* Global variable.  Only the name is significant.
31270114Sse   To find the address, look in the corresponding external symbol.  */
32270114Sse__define_stab (N_GSYM, 0x20, "GSYM")
33270114Sse
34267194Sray/* Function name for BSD Fortran.  Only the name is significant.
35267194Sray   To find the address, look in the corresponding external symbol.  */
36270114Sse__define_stab (N_FNAME, 0x22, "FNAME")
37270114Sse
38270114Sse/* Function name or text-segment variable for C.  Value is its address.
39270114Sse   Desc is supposedly starting line number, but GCC doesn't set it
40270114Sse   and DBX seems not to miss it.  */
41270114Sse__define_stab (N_FUN, 0x24, "FUN")
42270114Sse
43270114Sse/* Data-segment variable with internal linkage.  Value is its address.
44270114Sse   "Static Sym".  */
45270114Sse__define_stab (N_STSYM, 0x26, "STSYM")
46270114Sse
47270114Sse/* BSS-segment variable with internal linkage.  Value is its address.  */
48267194Sray__define_stab (N_LCSYM, 0x28, "LCSYM")
49267194Sray
50270114Sse/* Name of main routine.  Only the name is significant.  */
51270114Sse__define_stab (N_MAIN, 0x2a, "MAIN")
52270114Sse
53270114Sse/* Solaris2:  Read-only data symbols.  */
54270114Sse__define_stab (N_ROSYM, 0x2c, "ROSYM")
55270114Sse
56270114Sse/* Global symbol in Pascal.
57270114Sse   Supposedly the value is its line number; I'm skeptical.  */
58270114Sse__define_stab (N_PC, 0x30, "PC")
59267194Sray
60267194Sray/* Number of symbols:  0, files,,funcs,lines according to Ultrix V4.0. */
61267194Sray__define_stab (N_NSYMS, 0x32, "NSYMS")
62267194Sray
63267194Sray/* "No DST map for sym: name, ,0,type,ignored"  according to Ultrix V4.0. */
64267194Sray__define_stab (N_NOMAP, 0x34, "NOMAP")
65267194Sray
66267194Sray/* New stab from Solaris 2.  Like N_SO, but for the object file.  Two in
67267194Sray   a row provide the build directory and the relative path of the .o from it.
68267194Sray   Solaris2 uses this to avoid putting the stabs info into the linked
69267194Sray   executable; this stab goes into the ".stab.index" section, and the debugger
70267194Sray   reads the real stabs directly from the .o files instead.  */
71267194Sray__define_stab (N_OBJ, 0x38, "OBJ")
72267194Sray
73267194Sray/* New stab from Solaris 2.  Options for the debugger, related to the
74267194Sray   source language for this module.  E.g. whether to use ANSI
75267194Sray   integral promotions or traditional integral promotions.  */
76267194Sray__define_stab (N_OPT, 0x3c, "OPT")
77267194Sray
78267194Sray/* Register variable.  Value is number of register.  */
79267194Sray__define_stab (N_RSYM, 0x40, "RSYM")
80267194Sray
81267194Sray/* Modula-2 compilation unit.  Can someone say what info it contains?  */
82267194Sray__define_stab (N_M2C, 0x42, "M2C")
83267194Sray
84267194Sray/* Line number in text segment.  Desc is the line number;
85267194Sray   value is corresponding address.  On Solaris2, the line number is
86267194Sray   relative to the start of the current function.  */
87267194Sray__define_stab (N_SLINE, 0x44, "SLINE")
88267194Sray
89267194Sray/* Similar, for data segment.  */
90267194Sray__define_stab (N_DSLINE, 0x46, "DSLINE")
91267194Sray
92267194Sray/* Similar, for bss segment.  */
93267194Sray__define_stab (N_BSLINE, 0x48, "BSLINE")
94267194Sray
95267194Sray/* Sun's source-code browser stabs.  ?? Don't know what the fields are.
96267194Sray   Supposedly the field is "path to associated .cb file".  THIS VALUE
97267194Sray   OVERLAPS WITH N_BSLINE!  */
98267194Sray__define_stab_duplicate (N_BROWS, 0x48, "BROWS")
99267194Sray
100267194Sray/* GNU Modula-2 definition module dependency.  Value is the modification time
101267194Sray   of the definition file.  Other is non-zero if it is imported with the
102267194Sray   GNU M2 keyword %INITIALIZE.  Perhaps N_M2C can be used if there
103267194Sray   are enough empty fields? */
104267194Sray__define_stab(N_DEFD, 0x4a, "DEFD")
105267194Sray
106267194Sray/* New in Solaris2.  Function start/body/end line numbers.  */
107267194Sray__define_stab(N_FLINE, 0x4C, "FLINE")
108267194Sray
109267194Sray/* THE FOLLOWING TWO STAB VALUES CONFLICT.  Happily, one is for Modula-2
110267194Sray   and one is for C++.   Still,... */
111267194Sray/* GNU C++ exception variable.  Name is variable name.  */
112267194Sray__define_stab (N_EHDECL, 0x50, "EHDECL")
113267194Sray/* Modula2 info "for imc":  name,,0,0,0  according to Ultrix V4.0.  */
114267194Sray__define_stab_duplicate (N_MOD2, 0x50, "MOD2")
115267194Sray
116267194Sray/* GNU C++ `catch' clause.  Value is its address.  Desc is nonzero if
117267194Sray   this entry is immediately followed by a CAUGHT stab saying what exception
118267194Sray   was caught.  Multiple CAUGHT stabs means that multiple exceptions
119267194Sray   can be caught here.  If Desc is 0, it means all exceptions are caught
120267194Sray   here.  */
121267194Sray__define_stab (N_CATCH, 0x54, "CATCH")
122267194Sray
123267194Sray/* Structure or union element.  Value is offset in the structure.  */
124267194Sray__define_stab (N_SSYM, 0x60, "SSYM")
125267194Sray
126267194Sray/* Solaris2:  Last stab emitted for module.  */
127267194Sray__define_stab (N_ENDM, 0x62, "ENDM")
128267194Sray
129267194Sray/* Name of main source file.
130267194Sray   Value is starting text address of the compilation.
131267194Sray   If multiple N_SO's appear, the first to contain a trailing / is the
132267194Sray   compilation directory.  The first to not contain a trailing / is the
133267194Sray   source file name, relative to the compilation directory.  Others (perhaps
134267194Sray   resulting from cfront) are ignored.
135267194Sray   On Solaris2, value is undefined, but desc is a source-language code.  */
136267194Sray
137267194Sray__define_stab (N_SO, 0x64, "SO")
138267194Sray
139267194Sray/* SunPro F77:  Name of alias.  */
140267194Sray__define_stab (N_ALIAS, 0x6c, "ALIAS")
141267194Sray
142267194Sray/* Automatic variable in the stack.  Value is offset from frame pointer.
143267194Sray   Also used for type descriptions.  */
144267194Sray__define_stab (N_LSYM, 0x80, "LSYM")
145267194Sray
146267194Sray/* Beginning of an include file.  Only Sun uses this.
147293047Semaste   In an object file, only the name is significant.
148267194Sray   The Sun linker puts data into some of the other fields.  */
149267194Sray__define_stab (N_BINCL, 0x82, "BINCL")
150267194Sray
151270114Sse/* Name of sub-source file (#include file).
152270114Sse   Value is starting text address of the compilation.  */
153270114Sse__define_stab (N_SOL, 0x84, "SOL")
154270114Sse
155270114Sse/* Parameter variable.  Value is offset from argument pointer.
156270114Sse   (On most machines the argument pointer is the same as the frame pointer.  */
157270114Sse__define_stab (N_PSYM, 0xa0, "PSYM")
158270114Sse
159270114Sse/* End of an include file.  No name.
160270114Sse   This and N_BINCL act as brackets around the file's output.
161270114Sse   In an object file, there is no significant data in this entry.
162270114Sse   The Sun linker puts data into some of the fields.  */
163267194Sray__define_stab (N_EINCL, 0xa2, "EINCL")
164267194Sray
165270114Sse/* Alternate entry point.  Value is its address.  */
166270114Sse__define_stab (N_ENTRY, 0xa4, "ENTRY")
167270114Sse
168270114Sse/* Beginning of lexical block.
169270114Sse   The desc is the nesting level in lexical blocks.
170270114Sse   The value is the address of the start of the text for the block.
171270114Sse   The variables declared inside the block *precede* the N_LBRAC symbol.
172270114Sse   On Solaris2, the value is relative to the start of the current function.  */
173270114Sse__define_stab (N_LBRAC, 0xc0, "LBRAC")
174270114Sse
175270114Sse/* Place holder for deleted include file.  Replaces a N_BINCL and everything
176270114Sse   up to the corresponding N_EINCL.  The Sun linker generates these when
177267194Sray   it finds multiple identical copies of the symbols from an include file.
178267194Sray   This appears only in output from the Sun linker.  */
179270114Sse__define_stab (N_EXCL, 0xc2, "EXCL")
180270114Sse
181270114Sse/* Modula-2 scope information.  Can someone say what info it contains?  */
182270114Sse__define_stab (N_SCOPE, 0xc4, "SCOPE")
183270114Sse
184270114Sse/* Solaris2: Patch Run Time Checker.  */
185270114Sse__define_stab (N_PATCH, 0xd0, "PATCH")
186270114Sse
187270114Sse/* End of a lexical block.  Desc matches the N_LBRAC's desc.
188267194Sray   The value is the address of the end of the text for the block.
189267194Sray   On Solaris2, the value is relative to the start of the current function.  */
190267194Sray__define_stab (N_RBRAC, 0xe0, "RBRAC")
191267194Sray
192267194Sray/* Begin named common block.  Only the name is significant.  */
193267194Sray__define_stab (N_BCOMM, 0xe2, "BCOMM")
194267194Sray
195267194Sray/* End named common block.  Only the name is significant
196267194Sray   (and it should match the N_BCOMM).  */
197267194Sray__define_stab (N_ECOMM, 0xe4, "ECOMM")
198267194Sray
199267194Sray/* Member of a common block; value is offset within the common block.
200267194Sray   This should occur within a BCOMM/ECOMM pair.  */
201267194Sray__define_stab (N_ECOML, 0xe8, "ECOML")
202267194Sray
203267194Sray/* Solaris2: Pascal "with" statement: type,,0,0,offset */
204267194Sray__define_stab (N_WITH, 0xea, "WITH")
205267194Sray
206267194Sray/* These STAB's are used on Gould systems for Non-Base register symbols
207267194Sray   or something like that.  FIXME.  I have assigned the values at random
208267194Sray   since I don't have a Gould here.  Fixups from Gould folk welcome... */
209267194Sray__define_stab (N_NBTEXT, 0xF0, "NBTEXT")
210267194Sray__define_stab (N_NBDATA, 0xF2, "NBDATA")
211267194Sray__define_stab (N_NBBSS,  0xF4, "NBBSS")
212267194Sray__define_stab (N_NBSTS,  0xF6, "NBSTS")
213267194Sray__define_stab (N_NBLCS,  0xF8, "NBLCS")
214267194Sray
215267194Sray/* Second symbol entry containing a length-value for the preceding entry.
216267194Sray   The value is the length.  */
217267194Sray__define_stab (N_LENG, 0xfe, "LENG")
218267194Sray
219267194Sray/* The above information, in matrix format.
220267194Sray
221267194Sray			STAB MATRIX
222267194Sray	_________________________________________________
223267194Sray	| 00 - 1F are not dbx stab symbols		|
224267194Sray	| In most cases, the low bit is the EXTernal bit|
225267194Sray
226267194Sray	| 00 UNDEF  | 02 ABS	| 04 TEXT   | 06 DATA	|
227267194Sray	| 01  |EXT  | 03  |EXT	| 05  |EXT  | 07  |EXT	|
228267194Sray
229267194Sray	| 08 BSS    | 0A INDR	| 0C FN_SEQ | 0E WEAKA	|
230267194Sray	| 09  |EXT  | 0B 	| 0D WEAKU  | 0F WEAKT	|
231267194Sray
232267194Sray	| 10 WEAKD  | 12 COMM	| 14 SETA   | 16 SETT	|
233267194Sray	| 11 WEAKB  | 13	| 15 	    | 17	|
234267194Sray
235267194Sray	| 18 SETD   | 1A SETB	| 1C SETV   | 1E WARNING|
236267194Sray	| 19	    | 1B	| 1D 	    | 1F FN	|
237267194Sray
238267194Sray	|_______________________________________________|
239267194Sray	| Debug entries with bit 01 set are unused.	|
240267194Sray	| 20 GSYM   | 22 FNAME	| 24 FUN    | 26 STSYM	|
241267194Sray	| 28 LCSYM  | 2A MAIN	| 2C ROSYM  | 2E	|
242267194Sray	| 30 PC	    | 32 NSYMS	| 34 NOMAP  | 36	|
243	| 38 OBJ    | 3A	| 3C OPT    | 3E	|
244	| 40 RSYM   | 42 M2C	| 44 SLINE  | 46 DSLINE |
245	| 48 BSLINE*| 4A DEFD	| 4C FLINE  | 4E	|
246	| 50 EHDECL*| 52	| 54 CATCH  | 56        |
247	| 58        | 5A        | 5C        | 5E	|
248	| 60 SSYM   | 62 ENDM	| 64 SO	    | 66 	|
249	| 68 	    | 6A	| 6C ALIAS  | 6E	|
250	| 70	    | 72	| 74	    | 76	|
251	| 78	    | 7A	| 7C	    | 7E	|
252	| 80 LSYM   | 82 BINCL	| 84 SOL    | 86	|
253	| 88	    | 8A	| 8C	    | 8E	|
254	| 90	    | 92	| 94	    | 96	|
255	| 98	    | 9A	| 9C	    | 9E	|
256	| A0 PSYM   | A2 EINCL	| A4 ENTRY  | A6	|
257	| A8	    | AA	| AC	    | AE	|
258	| B0	    | B2	| B4	    | B6	|
259	| B8	    | BA	| BC	    | BE	|
260	| C0 LBRAC  | C2 EXCL	| C4 SCOPE  | C6	|
261	| C8	    | CA	| CC	    | CE	|
262	| D0 PATCH  | D2	| D4	    | D6	|
263	| D8	    | DA	| DC	    | DE	|
264	| E0 RBRAC  | E2 BCOMM	| E4 ECOMM  | E6	|
265	| E8 ECOML  | EA WITH	| EC	    | EE	|
266	| F0	    | F2	| F4	    | F6	|
267	| F8	    | FA	| FC	    | FE LENG	|
268	+-----------------------------------------------+
269 * 50 EHDECL is also MOD2.
270 * 48 BSLINE is also BROWS.
271 */
272