From: Kevin Buettner <kevinb@redhat.com>
To: Andrew Cagney <ac131313@redhat.com>, gdb-patches@sources.redhat.com
Subject: Re: [rfa/ppc] Use frame_align(); delete hack
Date: Thu, 26 Sep 2002 11:37:00 -0000 [thread overview]
Message-ID: <1020926183719.ZM19070@localhost.localdomain> (raw)
In-Reply-To: Andrew Cagney <ac131313@redhat.com> "[rfa/ppc] Use frame_align(); delete hack" (Sep 24, 7:07pm)
On Sep 24, 7:07pm, Andrew Cagney wrote:
> The extract struct return function is also modified so that it, for want
> of a better guess, returns register 3. The other option is to have that
> function return 0 (since it really doesn't know).
[...]
> + /* FIXME: This will only work at random. The caller passes the
> + struct_return address in register 3, but it is not preserved. It
> + may still be there, or this may be a random value. */
> + ULONGEST val;
> + regcache_cooked_read_unsigned (regcache, 3, &val);
> + return val;
I think returning 0 here is a better idea. If the function that
you're returning from has made any (non-nullary) calls, r3 will have
been overwritten. Even if it doesn't make any calls, r3 is still fair
game for the compiler to use as a temporary.
I'd like to see a comment pointing out the fact that gdb knows about
and is able to print struct return values in inferior function calls
due to the fact that gdb is the caller (and therefore knows the address
of the struct return buffer).
Otherwise, okay.
Kevin
next prev parent reply other threads:[~2002-09-26 18:37 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <3D90F04C.9040900@redhat.com>
2002-09-24 16:30 ` Kevin Buettner
2002-09-24 18:27 ` Andrew Cagney
2002-09-26 11:37 ` Kevin Buettner [this message]
2002-09-26 15:31 ` 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=1020926183719.ZM19070@localhost.localdomain \
--to=kevinb@redhat.com \
--cc=ac131313@redhat.com \
--cc=gdb-patches@sources.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