This is the mail archive of the gcc@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]

No 'g' stab type generated for pointer-to-function in C/C++ - suggestion for devel.


I'm new to the gcc lists, so I apologise deeply if this has already been
discussed to death.  I did perform a search of the archives and found
nothing relevant.

>From discussion on gdb development lists (circa Feb 2002) it appears
gdb supports the 'g' stab to convey function argument type information.  For
example,
 .stabs  "f1:G(1,1)=*(1,2)=g(0,1)(0,1)(0,1)#",32,0,0,0
is the corresponding stab for
 int (*f1)(int,int);

In fact I've tried this with gdb and a hex editor and it correctly reports
the type when I enter "whatis f1".

However gcc only emits plain 'f' stabs, such as
 .stabs  "f1:G(1,1)=*(1,2)=f(0,1)",32,0,0,0

which is equivalent to saying just
int (*f1)();

(i.e. the parameters of f1 are 'unknown').

Any two function pointers that return the same type are thus
indistinguishable, as the 'f' stab only declares return type, unlike the 'g'
stab which declares return type and the type of all function parameters.
So, gdb supports the 'g' stab but gcc doesn't ever generate it.  Has anyone
tried adding the 'g' stab output to dbxout.c ?
I've also posted a similar report to gcc-bugs

d


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