This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Using -gstabs may miss some stabs


On Tue, Feb 12, 2002 at 11:53:10AM -0700, Fred Fish wrote:
> 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.

Hmm, that happens because the trailing N_FUN is marked
``use_gnu_debug_info_extensions'' (use -gstabs+ to get it back).  I've
never been clear on what expects the stabs output without the
GNU debug info extensions (many or most of which are actually Sun's). 
Perhaps it's time to kill -gstabs?

-- 
Daniel Jacobowitz                           Carnegie Mellon University
MontaVista Software                         Debian GNU/Linux Developer


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]