dbx - dbx symbol table information
D
\bDE
\bES
\bSC
\bCR
\bRI
\bIP
\bPT
\bTI
\bIO
\bON
\bN
The compiler symbol information generated for _
\bd_
\bb_
\bx(1) uses
the same structure as described in _
\bs_
\bt_
\ba_
\bb(5), with additional
type and scope information appended to a symbol's name. The
assembler directive used to describe symbol information has
s
\bst
\bta
\bab
\bbs
\bs ``_
\bs_
\bt_
\br_
\bi_
\bn_
\bg'',_
\bk_
\bi_
\bn_
\bd,0,_
\bs_
\bi_
\bz_
\be,_
\bv_
\ba_
\bl_
\bu_
\be
_
\bS_
\bt_
\br_
\bi_
\bn_
\bg contains the name, source language type, and scope of
the symbol, _
\bk_
\bi_
\bn_
\bd specifies the memory class (e.g., external,
static, parameter, local, register), and _
\bs_
\bi_
\bz_
\be specifies the
byte size of the object, if relevant. The third field (0
above) is unused. For a global variable or a type, _
\bv_
\ba_
\bl_
\bu_
\be is
unused; for a local variable or parameter, it is the offset
from the frame pointer, for a register variable, it is the
associated register number.
The different kinds of stab entries are interpreted by dbx
N_GSYM The symbol is a global variable (e.g., .comm vari-
able). The variable's address can be found from
the corresponding ld(1) symbol entry, thus the
value field for N_GSYM symbols is ignored. For
example, a global variable ``x'' will have both an
N_GSYM entry and an _
\bl_
\bd(1) entry (e.g., N_BSS +
N_EXT). See _
\ba._
\bo_
\bu_
\bt(5) for details about these
N_FUN The symbol is a procedure or function. The size
field contains the line number of the entry point.
The value field contains the address of the entry
point (in the text segment).
N_STSYM The symbol is a statically allocated variable for
which an initial value has been specified. The
value field contains the address of the variable
N_LCSYM The symbol is statically allocated, but not ini-
N_RSYM The symbol is a register variable whose value is
kept in the register denoted by the value field.
N_PSYM The symbol is a parameter whose value is pushed on
the stack before the call. The value field con-
tains the offset from the argument base pointer
Printed 7/27/90 January 1
(on the VAX, the ap register).
N_LSYM The symbol is a local variable whose value is
stored in the most recently defined procedure's
stack frame. The value is the (often negative)
offset from the frame pointer (on the VAX, the fp
The symbol defines separate compilation informa-
tion for pre-linking checking for Berkeley Pascal
and DEC Modula-2 programs respectively. For Pas-
cal, the value field contains the line number that
the symbol is defined on. The value field is not
Most of the source level information about a symbol is
stored in the string field of the stab entry. Since strings
are kept in a separate string table in the a.out file, they
can be arbitrarily long. Thus there are no restrictions on
the kind or length of information in the string field, and
it was not necessary to modify the assembler or loader when
extending or modifying the format of this information.
Below is a grammar describing the syntax of the symbol
string. Except in the case of a constant whose value is a
string, there are no blanks in a symbol string.
NAME: [a-zA-Z_][a-zA-Z_0-9]*
REAL: [+-][0-9]*(.[0-9][0-9]*|)([eE]([+-]|)[0-9][0-9]*|)
`X' ExportInfo -- export or import information (for N_MOD2 only)
Printed 7/27/90 January 2
`S' TypeId `,' NumElements `,' NumBits `,' BSTRING
TypeId -- local variable of type TypeId
`r' TypeId -- register variable of type TypeId
`S' TypeId -- module variable of type TypeId (static global in C)
`V' TypeId -- own variable of type TypeId (static local in C)
`G' TypeId -- global variable of type TypeId
Proc -- top level procedure
Proc `,' NAME `,' NAME -- local to first NAME,
-- second NAME is corresponding ld symbol
`Q' -- local procedure (static in C)
`I' -- internal procedure (different calling sequence)
`F' TypeId -- function returning type TypeId
`f' TypeId -- local function
`J' TypeId -- internal function
`p' TypeId -- value parameter of type TypeId
`v' TypeId -- reference parameter of type TypeId
`t' TypeId -- type name for type TypeId
`T' TypeId -- C structure tag name for struct TypeId
INTEGER -- Unique (per compilation) number of type
INTEGER `=' TypeDef -- Definition of type number
INTEGER `=' TypeAttrs TypeDef
-- Type attributes are extra information associated with a type,
-- such as alignment constraints or pointer checking semantics.
-- Dbx interprets some of these, but will ignore rather than complain
-- about any it does not recognize. Therefore this is a way to add
-- extra information for pre-linking checking.
Printed 7/27/90 January 3
TypeAttrList `,' TypeAttr
`a' INTEGER -- align boundary
`s' INTEGER -- size in bits
`p' INTEGER -- pointer class (e.g., checking)
BSTRING -- something else
`e' EnumList `;' -- enumeration
`*' TypeId -- pointer to TypeId
`S' TypeId -- set of TypeId
`d' TypeId -- file of TypeId
`i' NAME `:' NAME `;' -- imported type ModuleName:Name
`o' NAME `;' -- opaque type
`i' NAME `:' NAME `,' TypeId `;'
`r' TypeId `;' INTEGER `;' INTEGER
`a' TypeId `;' TypeId -- array [TypeId] of TypeId
`A' TypeId -- open array of TypeId
`D' INTEGER `,' TypeId -- N-dim. dynamic array
`E' INTEGER `,' TypeId -- N-dim. subarray
`f' TypeId `;' -- C function type
`f' TypeId `,' NumParams `;' TParamList `;'
`p' NumParams `;' TParamList `;'
`s' ByteSize FieldList `;' -- structure/record
`u' ByteSize FieldList `;' -- C union
Printed 7/27/90 January 4
NAME `:' TypeId `,' BitOffset `,' BitSize `;'
NAME `:' TypeId `,' PassBy `;'
`f' TypeId `,' NumParams `;' ParamList `;'
`p' NumParams `;' ParamList `;'
A `?' indicates that the symbol information is continued in
the next stab entry. This directive can only occur where a
`;' would otherwise separate the fields of a record or con-
stants in an enumeration. It is useful when the number of
Printed 7/27/90 January 5
elements in one of these lists is large.
S
\bSE
\bEE
\bE A
\bAL
\bLS
\bSO
\bO
dbx(1), stab(5), a.out(5)
Printed 7/27/90 January 6