Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: gdb-patches@sources.redhat.com
Cc: Andrew Cagney <cagney@gnu.org>,
	Michael Elizabeth Chastain <mec.gnu@mindspring.com>,
	vinschen@redhat.com
Subject: Re: [RFC/RFA] gdb.cp/classes.exp: Don't try to print local variable out of scope
Date: Fri, 19 Mar 2004 00:09:00 -0000	[thread overview]
Message-ID: <20040310032351.GA16933@nevyn.them.org> (raw)
In-Reply-To: <20040310030528.GB16230@nevyn.them.org>

On Tue, Mar 09, 2004 at 10:05:29PM -0500, Daniel Jacobowitz wrote:
> Think about this for a moment.  I'm going to give addresses so that I
> can be more precise.
> 
> 0x10 <stuff>: ret		stuff(int) { }
> 0x20 <main>: push		main() {
> 0x21 <main+1>: push			{
> 0x22 <main+2>: move arg1, i			stuff(i)
> 0x23 <main+3>: call stuff			  "
> 0x24 <main+4>: pop			}
> 0x25 <main+5>: pop		}
> 0x26 <main+6>: ret		"
> 
> The inner scope is probably <main+2> to <main+3> inclusive.
> 
> Suppose PC == 0x10.  We backtrace.  Look at main; saved PC is 0x24.  We
> want an address in the block.  We subtract 1.  OK, saved addr-in-block
> is 0x23.  'i' is in scope.
> 
> Suppose PC == 0x24.  Shouldn't this be the same?  For the purposes of
> looking at local variables, aren't we still in the the block?
> 
> Suppose PC was 0x24 and we got a signal.  Ditto.
> 
> Suppose PC == 0x20 and we get a signal.  Obviously we don't want to
> change the behavior of this.

BTW, my proposed replacement is woefully inaccurate, which I should
have realized before posting.  I do not have a good solution to this
problem without actually turning back time :)

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


WARNING: multiple messages have this Message-ID
From: Daniel Jacobowitz <drow@false.org>
To: gdb-patches@sources.redhat.com
Cc: Andrew Cagney <cagney@gnu.org>,
	Michael Elizabeth Chastain <mec.gnu@mindspring.com>,
	vinschen@redhat.com
Subject: Re: [RFC/RFA] gdb.cp/classes.exp: Don't try to print local variable out of scope
Date: Wed, 10 Mar 2004 03:23:00 -0000	[thread overview]
Message-ID: <20040310032351.GA16933@nevyn.them.org> (raw)
Message-ID: <20040310032300.7P8MpuxyVT6MnPFyjKPTddpnhe0ZwLCIVgXP-zWlMO0@z> (raw)
In-Reply-To: <20040310030528.GB16230@nevyn.them.org>

On Tue, Mar 09, 2004 at 10:05:29PM -0500, Daniel Jacobowitz wrote:
> Think about this for a moment.  I'm going to give addresses so that I
> can be more precise.
> 
> 0x10 <stuff>: ret		stuff(int) { }
> 0x20 <main>: push		main() {
> 0x21 <main+1>: push			{
> 0x22 <main+2>: move arg1, i			stuff(i)
> 0x23 <main+3>: call stuff			  "
> 0x24 <main+4>: pop			}
> 0x25 <main+5>: pop		}
> 0x26 <main+6>: ret		"
> 
> The inner scope is probably <main+2> to <main+3> inclusive.
> 
> Suppose PC == 0x10.  We backtrace.  Look at main; saved PC is 0x24.  We
> want an address in the block.  We subtract 1.  OK, saved addr-in-block
> is 0x23.  'i' is in scope.
> 
> Suppose PC == 0x24.  Shouldn't this be the same?  For the purposes of
> looking at local variables, aren't we still in the the block?
> 
> Suppose PC was 0x24 and we got a signal.  Ditto.
> 
> Suppose PC == 0x20 and we get a signal.  Obviously we don't want to
> change the behavior of this.

BTW, my proposed replacement is woefully inaccurate, which I should
have realized before posting.  I do not have a good solution to this
problem without actually turning back time :)

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


  parent reply	other threads:[~2004-03-10  3:23 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-19  0:09 Michael Elizabeth Chastain
2004-03-09 16:15 ` Michael Elizabeth Chastain
2004-03-19  0:09 ` Andrew Cagney
2004-03-09 20:38   ` Andrew Cagney
2004-03-09 21:27   ` Daniel Jacobowitz
2004-03-09 22:32     ` Andrew Cagney
2004-03-19  0:09       ` Daniel Jacobowitz
2004-03-10  0:56         ` Daniel Jacobowitz
2004-03-19  0:09         ` Andrew Cagney
2004-03-10  1:51           ` Andrew Cagney
2004-03-10  3:05           ` Daniel Jacobowitz
2004-03-19  0:09             ` Daniel Jacobowitz
2004-03-19  0:09             ` Daniel Jacobowitz [this message]
2004-03-10  3:23               ` Daniel Jacobowitz
2004-03-10 22:21               ` Andrew Cagney
2004-03-10 22:29                 ` Daniel Jacobowitz
2004-03-15 18:47                   ` Andrew Cagney
2004-03-19  0:09                     ` Andrew Cagney
2004-03-19  0:09                   ` Daniel Jacobowitz
2004-03-19  0:09                 ` Andrew Cagney
2004-03-19  0:09       ` Andrew Cagney
2004-03-19  0:09     ` Daniel Jacobowitz
  -- strict thread matches above, loose matches on Subject: below --
2004-03-19  0:09 Michael Elizabeth Chastain
2004-03-10 23:58 ` Michael Elizabeth Chastain
2004-03-19  0:09 Corinna Vinschen
2004-03-09 13:00 ` Corinna Vinschen
2004-03-19  0:09 ` Daniel Jacobowitz
2004-03-09 14:17   ` Daniel Jacobowitz
2004-03-19  0:09 Michael Elizabeth Chastain
2004-03-09 15:11 ` Michael Elizabeth Chastain
2004-03-09 15:40 ` Corinna Vinschen
2004-03-19  0:09   ` Corinna Vinschen
2004-03-19  0:09 ` Daniel Jacobowitz
2004-03-09 15:20   ` Daniel Jacobowitz
2004-03-19  0:09 Michael Elizabeth Chastain
2004-03-09 15:27 ` Michael Elizabeth Chastain
2004-03-19  0:09 Michael Elizabeth Chastain
2004-03-10  2:06 ` Michael Elizabeth Chastain

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=20040310032351.GA16933@nevyn.them.org \
    --to=drow@false.org \
    --cc=cagney@gnu.org \
    --cc=gdb-patches@sources.redhat.com \
    --cc=mec.gnu@mindspring.com \
    --cc=vinschen@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