Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew Cagney <ac131313@redhat.com>
To: Michael Snyder <msnyder@redhat.com>
Cc: gdb-patches@sources.redhat.com, eliz@is.elta.co.il
Subject: Re: [SO obvious...] make struct_return work for hand_function_call
Date: Thu, 31 Jul 2003 02:26:00 -0000	[thread overview]
Message-ID: <3F287E4D.9040106@redhat.com> (raw)
In-Reply-To: <3F28321A.7040201@redhat.com>

> God, we've struggled with this for years... the answer is so obvious!

Er, struct return already works for hand call functions.  Vis:

   /* NOTE: cagney/2002-09-10: Only when the stack has been correctly
      aligned (using frame_align()) do we can trust STRUCT_ADDR and
      fetch the return value direct from the stack.  This lack of trust
      comes about because legacy targets have a nasty habit of
      silently, and local to PUSH_ARGUMENTS(), moving STRUCT_ADDR.  For
      such targets, just hope that value_being_returned() can find the
      adjusted value.  */
   if (struct_return && gdbarch_frame_align_p (current_gdbarch))
     {
       struct value *retval = value_at (value_type, struct_addr, NULL);
       do_cleanups (retbuf_cleanup);
       return retval;
     }
   else
     {
       struct value *retval = value_being_returned (value_type, retbuf,
                                                    struct_return);
       do_cleanups (retbuf_cleanup);
       return retval;
     }

If your architecture provides frame_align(), and does not it will all work.

I think all those changes can be reverted.

> Eli, this generalizes some special-purpose code that you wrote for HP,
> which now becomes redundant and may be removed.

BTW, Elz is Elena.

Andrew



  reply	other threads:[~2003-07-31  2:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-30 21:01 Michael Snyder
2003-07-31  2:26 ` Andrew Cagney [this message]
2003-07-31 22:27   ` 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=3F287E4D.9040106@redhat.com \
    --to=ac131313@redhat.com \
    --cc=eliz@is.elta.co.il \
    --cc=gdb-patches@sources.redhat.com \
    --cc=msnyder@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