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]

Using -gstabs may miss some stabs


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


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