This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Using -gstabs may miss some stabs
- From: Fred Fish <fnf at fred dot ninemoons dot com>
- To: gcc-bugs at gcc dot gnu dot org
- Cc: fnf at ninemoons dot com
- Date: Tue, 12 Feb 2002 11:53:10 -0700 (MST)
- Subject: Using -gstabs may miss some stabs
- Reply-to: fnf at ninemoons dot com
I just noticed something. Using the gcc released with Redhat Linux
7.2 (gcc version 2.96 20000731) if you give it the option -gstabs, the
FUN stabs that terminate functions are missing:
$ /usr/bin/g++ -g -S p1.cpp
$ grep ,36, p1.s
.stabs "main__9MainClass:F(0,21)",36,0,12,main__9MainClass
.stabs "",36,0,0,.Lscope0-main__9MainClass
.stabs "main:F(0,1)",36,0,16,main
.stabs "",36,0,0,.Lscope1-main
.stabs "__tf9MainClass:F(0,37)=&(0,38)=xstype_info:",36,0,9,__tf9MainClass
.stabs "",36,0,0,.Lscope2-__tf9MainClass
.stabs "__9MainClass:F(0,25)",36,0,6,__9MainClass
.stabs "",36,0,0,.Lscope3-__9MainClass
.stabs "_._9MainClass:F(0,21)",36,0,7,_._9MainClass
.stabs "",36,0,0,.Lscope4-_._9MainClass
$ /usr/bin/g++ -gstabs -S p1.cpp
$ grep ,36, p1.s
.stabs "main__9MainClass:F(0,21)",36,0,0,main__9MainClass
.stabs "main:F(0,1)",36,0,0,main
.stabs "__tf9MainClass:F(0,31)=*(0,32)=xstype_info:",36,0,0,__tf9MainClass
.stabs "__9MainClass:F(0,25)",36,0,0,__9MainClass
.stabs "_._9MainClass:F(0,21)",36,0,0,_._9MainClass
$
Notice in the first compile, the default is stabs, and each function
generates a leading and trailing FUN stab.
However when explicitly specifying stabs via "-gstabs", the trailing
stabs are missing.
This also seems to be the case for sourceware gcc:
$ /usr/sourceware/bin/g++ -gstabs -S p1.cpp
$ grep ,36, p1.s
.stabs "_ZN9MainClass4mainEv:F(9,7)",36,0,0,_ZN9MainClass4mainEv
.stabs "main:F(0,1)",36,0,0,main
$
Gdb does look for and use the trailing stab BTW.
-Fred