Go to the first, previous, next, last section, table of contents.
-
For GNU C stabs defining local and global variables (N_LSYM and
N_GSYM), the desc field is supposed to contain the source line number
on which the variable is defined. In reality the desc field is always
0. (This behavour is defined in dbxout.c and putting a line number in
desc is controlled by #ifdef WINNING_GDB which defaults to false). Gdb
supposedly uses this information if you say 'list var'. In reality
var can be a variable defined in the program and gdb says `function
var not defined'
-
In GNU C stabs there seems to be no way to differentiate tag types:
structures, unions, and enums (symbol descriptor T) and typedefs
(symbol descriptor t) defined at file scope from types defined locally
to a procedure or other more local scope. They all use the N_LSYM
stab type. Types defined at procedure scope are emited after the
N_RBRAC of the preceding function and before the code of the
procedure in which they are defined. This is exactly the same as
types defined in the source file between the two procedure bodies.
GDB overcompensates by placing all types in block #1 the block for
symbols of file scope. This is true for default, -ansi and
-traditional compiler options. (p0001063-gcc, p0001066-gdb)
-
What ends the procedure scope? Is it the proc block's N_RBRAC or the
next N_FUN? (I believe its the first.)
-
The comment in xcoff.h says DBX_STATIC_CONST_VAR_CODE is used for
static const variables. DBX_STATIC_CONST_VAR_CODE is set to N_FUN by
default, in dbxout.c. If included, xcoff.h redefines it to N_STSYM.
But testing the default behaviour, my Sun4 native example shows
N_STSYM not N_FUN is used to describe file static initialized
variables. (the code tests for TREE_READONLY(decl) &&
!TREE_THIS_VOLATILE(decl) and if true uses DBX_STATIC_CONST_VAR_CODE).
-
Global variable stabs don't have location information. This comes
from the external symbol for the same variable. The external symbol
has a leading underbar on the _name of the variable and the stab does
not. How do we know these two symbol table entries are talking about
the same symbol when their names are different?
-
Can gcc be configured to output stabs the way the Sun compiler
does, so that their native debugging tools work? <NO?> It doesn't by
default. GDB reads either format of stab. (gcc or SunC). How about
dbx?
Go to the first, previous, next, last section, table of contents.