Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jim Blandy <jimb@zwingli.cygnus.com>
To: Andrew Cagney <ac131313@cygnus.com>
Cc: Daniel Jacobowitz <drow@mvista.com>,
	gdb-patches@sources.redhat.com, Jason Merrill <jason@redhat.com>
Subject: Re: RFA: MI tests: tolerate prototypes
Date: Thu, 07 Feb 2002 11:01:00 -0000	[thread overview]
Message-ID: <npg04di07b.fsf@zwingli.cygnus.com> (raw)
In-Reply-To: <3C61C6EB.5060908@cygnus.com>


> Jim, my preference here is more along your proposal - have an explicit
> ``prototype-unknown'' state.
> 
>  From memory the last time this came up I also suggested here that
> changing the default behavour across GDB is probably a good thing.  I
> don't think this is something that individual targets should be
> deciding.  Instead GDB should exibit consistent behavour across
> host/target combinations, the decision being made on the basis of the
> debug info.

Well, I wouldn't call it target-specific.  The compromise we're making
is more like this:

GCC's STABS describe prototyped function types as if they were
non-prototyped function types.  However, it does provide accurate
pass-as types for function definitions.  This means that GDB can
correctly call functions under STABS if it reads function definition
types *as if* they were prototyped, using the pass-as types as the
argument types.

The downsides of this proposal:

- GDB will print function argument types incorrectly.  For example, 
  suppose we have the following function definition:

     int f (short s, float f) { return s + f; }

  Since the arguments' pass-as types for `s' and `f' are `int' and
  `double', GDB will print f's type as `int f(int, double)'.  This is
  weird, but it's a direct consequence of lying about the type.
 
- Since GCC still doesn't really emit function types accurately, we
  won't always be able to correctly call pointed-to functions.  But
  this is true now, and the `maybe-prototyped' change wouldn't fix
  this either.


  parent reply	other threads:[~2002-02-07 19:01 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-03 13:04 Jim Blandy
2002-02-03 15:01 ` Daniel Jacobowitz
2002-02-05 15:54   ` Jim Blandy
2002-02-05 17:21     ` Daniel Jacobowitz
2002-02-05 20:30       ` Jim Blandy
2002-02-05 21:48         ` Daniel Jacobowitz
2002-02-06 10:48           ` Jim Blandy
2002-02-06 16:14             ` Andrew Cagney
2002-02-06 16:24               ` Daniel Jacobowitz
2002-02-07 11:01               ` Jim Blandy [this message]
2002-02-07 12:27                 ` Daniel Jacobowitz
2002-02-08 10:03                   ` Jim Blandy
2002-02-08  5:16       ` function pointer stabs (was Re: RFA: MI tests: tolerate prototypes) Jason Merrill
2002-02-08  7:44         ` Daniel Jacobowitz
2002-02-08 11:37           ` Jim Blandy
2002-02-08 14:51           ` Jim Blandy
2002-02-09 12:15             ` Jim Blandy
2002-02-09 14:13               ` Daniel Jacobowitz
2002-02-03 16:29 ` RFA: MI tests: tolerate prototypes Andrew Cagney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=npg04di07b.fsf@zwingli.cygnus.com \
    --to=jimb@zwingli.cygnus.com \
    --cc=ac131313@cygnus.com \
    --cc=drow@mvista.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=jason@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox