Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: Orjan Friberg <orjan.friberg@axis.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: Function argument no longer in register
Date: Mon, 29 Mar 2004 14:25:00 -0000	[thread overview]
Message-ID: <20040329142536.GA14990@nevyn.them.org> (raw)
In-Reply-To: <406830DF.10109@axis.com>

On Mon, Mar 29, 2004 at 04:21:19PM +0200, Orjan Friberg wrote:
> Hi all,
> 
> What should happen when a function argument goes out of scope because 
> the register used to pass it is now used for something else?  I 
> encountered the following situation:
> 
> foo (char *str)
> {
>   ...
>   i = bar ();
>   ...
> }
> 
> The str argument is passed in register r10, which is then overwritten 
> with the return value from bar.  If I stop somewhere after the call to 
> bar and try to "print str", GDB will try to read from the address 
> pointed out by r10 (i.e. sends an 'm' packet to the remote stub).
> 
> I don't know what kind of problem I'm looking at here.  Could it be that 
> the debug information is wrong?  I'm guessing GDB somehow fails to 
> realize that the function argument is out of scope at this point.

Nothing's wrong - eventually, versions of GCC with proper location list
will tell GDB that the variable is out of scope, but no released
version does that.  I think 3.5 snapshots will.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


  reply	other threads:[~2004-03-29 14:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-29 14:21 Orjan Friberg
2004-03-29 14:25 ` Daniel Jacobowitz [this message]
2004-03-29 14:44   ` Orjan Friberg

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=20040329142536.GA14990@nevyn.them.org \
    --to=drow@false.org \
    --cc=gdb-patches@sources.redhat.com \
    --cc=orjan.friberg@axis.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