public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* No 'g' stab type generated for pointer-to-function in C/C++ - suggestion for devel.
@ 2003-01-04  0:59 Dave Hooper
  0 siblings, 0 replies; only message in thread
From: Dave Hooper @ 2003-01-04  0:59 UTC (permalink / raw)
  To: gcc

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-01-04  0:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-04  0:59 No 'g' stab type generated for pointer-to-function in C/C++ - suggestion for devel Dave Hooper

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).