Go to the first, previous, next, last section, table of contents.

Expanded reference by stab type.

Format of an entry: The first line is the symbol type expressed in decimal, hexadecimal, and as a #define (see devo/include/aout/stab.def).

The second line describes the language constructs the symbol type represents.

The third line is the stab format with the significant stab fields named and the rest NIL.

Subsequent lines expand upon the meaning and possible values for each significant stab field. # stands in for the type descriptor.

Finally, any further information.

32 - 0x20 - N_GYSM

Global variable.

.stabs "name", N_GSYM, NIL, NIL, NIL
"name" -> "symbol_name:#type"
                       # -> G

Only the "name" field is significant. the location of the variable is obtained from the corresponding external symbol.

34 - 0x22 - N_FNAME

Function name (for BSD Fortran)

.stabs "name", N_FNAME, NIL, NIL, NIL
"name" -> "function_name" 

Only the "name" field is significant. The location of the symbol is obtained from the corresponding extern symbol.

36 - 0x24 - N_FUN

Function name or text segment variable for C.

.stabs "name", N_FUN, NIL, desc, value
For functions:
"name" -> "proc_name:#return_type"
                     #  -> F (global function)
                           f (local function)
desc  -> line num for proc start.  (GCC doesn't set and DBX doesn't miss it.)
value -> Code address of proc start.

For text segment variables:
<<How to create one?>>

38 - 0x26 - N_STSYM

Initialized static symbol (data segment w/internal linkage).

.stabs "name", N_STSYM, NIL, NIL, value
"name" -> "symbol_name#type"
                      # -> S (scope global to compilation unit)
                        -> V (scope local to a procedure)
value  -> Data Address

40 - 0x28 - N_LCSYM

Unitialized static (.lcomm) symbol(BSS segment w/internal linkage).

.stabs "name", N_LCLSYM, NIL, NIL, value
"name" -> "symbol_name#type"
                      # -> S (scope global to compilation unit)
                        -> V (scope local to procedure)
value  -> BSS Address

42 - 0x2a - N_MAIN

Name of main routine (not used in C)

.stabs "name", N_MAIN, NIL, NIL, NIL
"name" -> "name_of_main_routine"  

48 - 0x30 - N_PC

Global symbol (for Pascal)

.stabs "name", N_PC, NIL, NIL, value
"name" -> "symbol_name"  <<?>>
value  -> supposedly the line number (stab.def is skeptical)
stabdump.c says: 

global pascal symbol: name,,0,subtype,line 
<< subtype? >>

50 - 0x32 - N_NSYMS

Number of symbols (according to Ultrix V4.0)

        0, files,,funcs,lines (stab.def)

52 - 0x34 - N_NOMAP

no DST map for sym (according to Ultrix V4.0)

        name, ,0,type,ignored (stab.def)

64 - 0x40 - N_RSYM

register variable

.stabs "name:type",N_RSYM,0,RegSize,RegNumber (Sun doc)

66 - 0x42 - N_M2C

Modula-2 compilation unit

.stabs "name", N_M2C, 0, desc, value
"name" -> "unit_name,unit_time_stamp[,code_time_stamp]
desc   -> unit_number
value  -> 0 (main unit)
          1 (any other unit)

68 - 0x44 - N_SLINE

Line number in text segment

.stabn N_SLINE, 0, desc, value
desc  -> line_number
value -> code_address (relocatable addr where the corresponding code starts)

For single source lines that generate discontiguous code, such as flow of control statements, there may be more than one N_SLINE stab for the same source line. In this case there is a stab at the start of each code range, each with the same line number.

70 - 0x46 - N_DSLINE

Line number in data segment

.stabn N_DSLINE, 0, desc, value
desc  -> line_number
value -> data_address (relocatable addr where the corresponding code

See comment for N_SLINE above.

72 - 0x48 - N_BSLINE

Line number in bss segment

.stabn N_BSLINE, 0, desc, value
desc  -> line_number
value -> bss_address (relocatable addr where the corresponding code

See comment for N_SLINE above.

72 - 0x48 - N_BROWS

Sun source code browser, path to .cb file

<<?>> "path to associated .cb file"

Note: type field value overlaps with N_BSLINE

74 - 0x4a - N_DEFD

GNU Modula2 definition module dependency

GNU Modula-2 definition module dependency. Value is the modification time of the definition file. Other is non-zero if it is imported with the GNU M2 keyword %INITIALIZE. Perhaps N_M2C can be used if there are enough empty fields?

80 - 0x50 - N_EHDECL

GNU C++ exception variable <<?>>

"name is variable name"

Note: conflicts with N_MOD2.

80 - 0x50 - N_MOD2

Modula2 info "for imc" (according to Ultrix V4.0)

Note: conflicts with N_EHDECL <<?>>

84 - 0x54 - N_CATCH

GNU C++ "catch" clause

GNU C++ `catch' clause. Value is its address. Desc is nonzero if this entry is immediately followed by a CAUGHT stab saying what exception was caught. Multiple CAUGHT stabs means that multiple exceptions can be caught here. If Desc is 0, it means all exceptions are caught here.

96 - 0x60 - N_SSYM

Structure or union element

Value is offset in the structure.

<<?looking at structs and unions in C I didn't see these>>

100 - 0x64 - N_SO

Path and name of source file containing main routine

.stabs "name", N_SO, NIL, NIL, value
"name" -> /path/to/source/file
       -> source_file_terminal_name

value  -> the starting text address of the compilation.

These are found two in a row. The name field of the first N_SO contains the path to the source file. The name field of the second N_SO contains the terminal name of the source file itself.

128 - 0x80 - N_LSYM

Automatic var in the stack (also used for type descriptors.)

.stabs "name" N_LSYM, NIL, NIL, value
For stack based local variables:

"name" -> name of the variable
value  -> offset from frame pointer (negative)

For type descriptors:

"name"   -> "name_of_the_type:#type"
                              # -> t

type     -> type_ref (or) type_def

type_ref -> type_number
type_def -> type_number=type_desc etc.

Type may be either a type reference or a type definition. A type reference is a number that refers to a previously defined type. A type definition is the number that will refer to this type, followed by an equals sign, a type descriptor and the additional data that defines the type. See the Table D for type descriptors and the section on types for what data follows each type descriptor.

130 - 0x82 - N_BINCL

Beginning of an include file (Sun only)

Beginning of an include file. Only Sun uses this. In an object file, only the name is significant. The Sun linker puts data into some of the other fields.

132 - 0x84 - N_SOL

Name of a sub-source file (#include file). Value is starting address of the compilation. <<?>>

160 - 0xa0 - N_PSYM

Parameter variable

stabs. "name", N_PSYM, NIL, NIL, value
"name" -> "param_name:#type"
                     # -> p  (value parameter)
                       -> i  (value parameter by reference, indirect access)
                       -> v  (variable parameter by reference)
                       -> C  ( read-only parameter, conformant array bound)
                       -> x  (confomant array value parameter)
                       -> pP (<<??>>)
                       -> pF (<<??>>)
                       -> X  (function result variable)
                       -> b  (based variable)

value -> offset from the argument pointer (positive).  

On most machines the argument pointer is the same as the frame pointer.

162 - 0xa2 - N_EINCL

End of an include file. This and N_BINCL act as brackets around the file's output. In an ojbect file, there is no significant data in this entry. The Sun linker puts data into some of the fields. <<?>>

164 - 0xa4 - N_ENTRY

Alternate entry point. Value is its address. <<?>>

192 - 0xc0 - N_LBRAC

Beginning of a lexical block (left brace). The variable defined inside the block precede the N_LBRAC symbol. Or can they follow as well as long as a new N_FUNC was not encountered. <<?>>

.stabn N_LBRAC, NIL, NIL, value
value -> code address of block start.

194 - 0xc2 - N_EXCL

Place holder for a deleted include file. Replaces a N_BINCL and everything up to the corresponding N_EINCL. The Sun linker generates these when it finds multiple indentical copies of the symbols from an included file. This appears only in output from the Sun linker. <<?>>

196 - 0xc4 - N_SCOPE

Modula2 scope information (Sun linker) <<?>>

224 - 0xe0 - N_RBRAC

End of a lexical block (right brace)

.stabn N_RBRAC, NIL, NIL, value
value -> code address of the end of the block.

226 - 0xe2 - N_BCOMM

Begin named common block.

Only the name is significant. <<?>>

228 - 0xe4 - N_ECOMM

End named common block.

Only the name is significant and it should match the N_BCOMM <<?>>

232 - 0xe8 - N_ECOML

End common (local name)

value is address. <<?>>

Non-base registers on Gould systems

<< used on Gould systems for non-base registers syms, values assigned at random, need real info from Gould. >> <<?>>

240    0xf0     N_NBTEXT  ??
242    0xf2     N_NBDATA  ??
244    0xf4     N_NBBSS   ??
246    0xf6     N_NBSTS   ??
248    0xf8     N_NBLCS   ??

- 0xfe - N_LENG

Second symbol entry containing a length-value for the preceding entry. The value is the length.

Go to the first, previous, next, last section, table of contents.