[Bug debug/9957] gcc -g does not seem to produce the correct stabs for source file

carlo at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Fri Oct 3 12:17:00 GMT 2003


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9957



------- Additional Comments From carlo at gcc dot gnu dot org  2003-10-03 12:17 -------
This is indeed invalid.
The N_SO stabs entry for a .c file is the first for
that compilation unit (each .c file being its own
compilation unit usually, unless you #include it)
and is generated as:

.stabs "/path/sourcefile.c",100,0,0,.Ltext0
.text
.Ltext0

at the top of its assembly file (.s).  See for example
http://www.informatik.uni-frankfurt.de/doc/texi/stabs_2.html#IDX2

therefore '.Ltext0' is always the first entry in
the .text segment and will have offset (n_value) 0.

A debugger will in most cases ignore the value anyway,
because the only interesting value is the path/sourcefile
change/setting and the affected .stab* entries will immedeately
follow it.



More information about the Gcc-bugs mailing list