This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB 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]

RFC: Stabs and prototyping


I've done some investigation on the float/double coercion problems.  These
are my results (this is all for stabs):

  - GCC does not use the Sun extensions for specifying prototypes.  However,
   the types of parameters listed are the promoted types for unprototyped
   functions and the unpromoted types for prototyped functions.  Thus,
   we can treat the stabs as being prototyped, always.  There will be a
   minor cosmetic glitch because we do not have information on how the
   function was 'really' declared, but that's it.  This behavior goes
   back to at least 2.7.2.3.

  - SUN CC does use the Sun extension for specifying prototypes,
   unsurprisingly.  However, it does not use it as one might think. 
   Functions with prototypes appear as expected, with both parameter
   stabs and a prototyped function type.  Unprototyped functions
   also have _BOTH_, but they may disagree.  That is, when we set
   TYPE_FLAG_PROTOTYPED based on having seen a prototype in the 'F:'
   stab, that just means we know precisely how to call it.  The 'parameter'
   stabs on the next lines have the 'declared' types.

So for SUN CC we set TYPE_FLAG_PROTOTYPED for all functions using stabs.  I
believe that for GCC we should do the same.  I don't know what effect this
will have on other compilers, but if we have enough information to make it
work at all then I expect this is the way it will work.

I'd appreciate a third datapoint if someone has, say, an AIX or HPUX
compiler available.  I'd appreciate it even more if said person could get me
access to said machine, of course :)

If this assumption holds for a third compiler, then the best thing for us to
do would be to set TYPE_FLAG_PROTOTYPED in stabs input for all functions,
IMO.  I'd like to clean up other debug formats too, but I don't even know
how many of our symbol readers are live.

-- 
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]