Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Michael Snyder <msnyder@redhat.com>
To: Andrew Cagney <ac131313@ges.redhat.com>
Cc: Kevin Buettner <kevinb@redhat.com>, gdb-patches@sources.redhat.com
Subject: Re: [RFA] Generic solution for store_struct_address
Date: Mon, 26 Aug 2002 17:50:00 -0000	[thread overview]
Message-ID: <3D6AC7C4.41BD8135@redhat.com> (raw)
In-Reply-To: <3D6ABFA1.6010407@ges.redhat.com>

Andrew Cagney wrote:
> 
> > Andrew Cagney wrote:
> >
> >>
> >
> >> > On Aug 21,  7:22pm, Michael Snyder wrote:
> >> >
> >> >
> >
> >> >> Kevin, would you by any chance be in a position to test it on ia64
> >> >> and/or
> >> >> rs6000?
> >
> >> >
> >> >
> >> > Sure, I'll give it a spin...
> >
> >>
> >> Just FYI, given the thread:
> >> http://sources.redhat.com/ml/gdb-patches/2002-08/msg00674.html
> >> I'm assuming that this patch is dropped.
> >
> >
> > Why?  I didn't drop it.  You commented that using generic dummy
> > frames was a better solution, but it remains true that some
> > targets do not use generic dummy frames, and I'm not sure that
> > all targets can use them.
> 
> You mean:
> 
> >> Adding such a field to the generic dummy frame is a good idea --
> >> but some architectures don't use the generic dummy frames.
> 
> > That can be fixed by converting the architecture to generic dummy frames :-)
> 
> That is a side issue --- anyone fixing a problem need only get it
> working with targets using generic dummy frames.  Any other target
> should first be converted to generic dummy frames anyway.

That may or may not be possible. 

> Anyway, summarizing posts such as:
> 
> http://sources.redhat.com/ml/gdb-patches/2002-08/msg00688.html
> http://sources.redhat.com/ml/gdb-patches/2002-08/msg00705.html
> 
> > As far as I know, there are two cases:
> >
> > 1. a normal function forced to return:
> > (gdb) break foo
> > (gdb) finish
> 
> Your patch does not, and cannot fix this case.

I know that.  It does fix case 2, and that's an improvement.


> > 2. an inferior function call:
> > (gdb) print foo()
> 
> Your patch fixes this case.  However, it is far easier to replace the
> infrun.c code block:
> 
> > * Figure out the value returned by the function. */
> > /* elz: I defined this new macro for the hppa architecture only.
> > this gives us a way to get the value returned by the function from the stack,
> > at the same address we told the function to put it.
> > We cannot assume on the pa that r28 still contains the address of the returned
> > structure. Usually this will be overwritten by the callee.
> > I don't know about other architectures, so I defined this macro
> > */
> >
> > #ifdef VALUE_RETURNED_FROM_STACK
> > if (struct_return)
> > {
> > do_cleanups (retbuf_cleanup);
> > return VALUE_RETURNED_FROM_STACK (value_type, struct_addr);
> > }
> > #endif
> 
> With the corresponding code lifted from HP/UX.

Andrew, this approach has the same short-coming as the approach
that you rejected when I tried to use it last week.  It has no
stack.  It will not handle nested target function calls, because
this part of gdb is not recursive.  The patch that I am submitting
here does not have that problem -- it keeps nested return addresses
in a stack.


  reply	other threads:[~2002-08-27  0:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-08-21 19:38 Michael Snyder
2002-08-26 15:52 ` Kevin Buettner
2002-08-26 16:01   ` Andrew Cagney
2002-08-26 16:14     ` Michael Snyder
2002-08-26 17:28       ` Andrew Cagney
2002-08-26 17:50         ` Michael Snyder [this message]
2002-08-27  8:17           ` 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=3D6AC7C4.41BD8135@redhat.com \
    --to=msnyder@redhat.com \
    --cc=ac131313@ges.redhat.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=kevinb@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