This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: RFC: Slay COERCE_FLOAT_TO_DOUBLE
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: Andrew Cagney <ac131313 at redhat dot com>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Tue, 7 Jan 2003 13:16:20 -0500
- Subject: Re: RFC: Slay COERCE_FLOAT_TO_DOUBLE
- References: <20021223203031.GA18990@nevyn.them.org> <3E1A0655.2050009@redhat.com>
On Mon, Jan 06, 2003 at 05:42:29PM -0500, Andrew Cagney wrote:
> >Stabs compilers (I only checked GCC and Sun Workshop CC, but those are the
> >two major ones) emit the call-as type in the debug information. I.E. an
> >unprototyped function taking a float argument will have a type signature
> >that says it takes a double. So the easy thing to do for stabs is to set
> >TYPE_FLAG_PROTOTYPED always, with appropriate commentary. I've done this.
> >It caused a minor bit of testsuite churn, since some ()'s became (void)'s;
> >I
> >think that's OK, we know they are really void functions anyway.
>
> Can you expand a bit here. When exactly do the () become (void)?
> Looking at the changes to stabs, mdebug and hpread it appears to reverse
> the default for all non dwarf* cases - assume prototyped rather than
> un-prototyped? That's a pretty radical change and needs to be clearly
> spelt out in at least the NEWS file.
>
> (Like many people I'm back from a break and am only just getting to
> these e-mails. This is probably why there were few responses earlier.)
I did explain this but I wasn't quite verbose enough, in the paragraph above
and several others in the message you're quoting. Let me try to be
more thorough.
* DWARF, DWARF-2: unchanged
* stabs: all functions are now marked prototyped.
This is consistent with the debugging information emitted by Sun CC
and by GCC. The type emitted is only the correct way to call the
function _if_ you assume that it is a prototyped declaration.
It's a call-as type, not a declared-as type. Treating it like
a prototype gives us the correct behavior.
* mdebug, hpread: All non-C functions are marked as prototyped
Only C of the languages supported on these targets supports
non-prototyped functions. This does _not_ change current behavior
because they acheived a similar hack in their coerce methods.
The only change is that some functions _whose signature we know to have
no arguments_ are now printed as foo(void) instead of foo(). That and
COERCE_FLOAT_TO_DOUBE are what we used TYPE_FLAG_PROTOTYPED for. It's
not a change of general impact; I'm only talking about some code in the
type pretty-printer.
For C the "assume un-prototyped" behavior was left intact, not
radically changed.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer