This is the mail archive of the
mailing list for the GDB project.
Re: function pointer stabs (was Re: RFA: MI tests: tolerate prototypes)
On Fri, Feb 08, 2002 at 01:16:10PM +0000, Jason Merrill wrote:
> >>>>> "Daniel" == Daniel Jacobowitz <firstname.lastname@example.org> writes:
> > Of course those have the same types. But even if you differentiate
> > them, stabs only describes function pointers by their return type.
> > Quite regrettable; it must be a GCC bug or at least limitation. This
> > is the one that's actually related to the patch at the start of this
> > thread. I think that the patch is fine, but that this should go on our
> > list of things to fix in GCC's debug output. Jason, I don't suppose
> > you could look at it? The 'right' thing to do would be to emit the Sun
> > extension for any prototyped function or properly declared (prototyped,
> > essentially) function pointer.
> >On Tue, Feb 05, 2002 at 06:56:04PM -0500, Jim Blandy wrote:
> >> Anyway, there's a standard syntax for prototyped function types
> >> defined in the STABS manual. GDB even reads it. If GCC would just
> >> emit it, things would be better.
> Looking at stabsread.c:read_type:case 'f', I don't see any support for
> reading parameter types.
For function definitions, it's in define_symbol. First it falls in to
process_function_types, then into process_prototype_types, where it
/* Sun acc puts declared types of arguments here. */
if (*p == ';')
But the only thing we need that information for AFAIK is curiousity.
We don't really need to know if the function was originally prototyped
if we know how it should be called.
For function TYPES, there's vestigial support for ignoring an os9k
prototype, but no support for the Sun prototypes. I stand corrected.
Should we add this, or write it off?
> Also, the spec in stabs.texi seems to describe different extensions for
> expressing parameters to actual functions versus function pointers.
Hmm, yes, I had not seen that.
Daniel Jacobowitz Carnegie Mellon University
MontaVista Software Debian GNU/Linux Developer