Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Martin Baulig <martin@gnome.org>
To: Daniel Jacobowitz <drow@mvista.com>
Cc: gdb@sources.redhat.com, Momchil Velikov <velco@fadata.bg>
Subject: Re: Lifetime of local variables
Date: Sat, 13 Apr 2002 12:53:00 -0000	[thread overview]
Message-ID: <86vgav77oa.fsf@einstein.home-of-linux.org> (raw)
In-Reply-To: <20020413143246.B13608@nevyn.them.org>

Daniel Jacobowitz <drow@mvista.com> writes:

> On Sat, Apr 13, 2002 at 01:31:05PM +0200, Martin Baulig wrote:
> > Daniel Jacobowitz <drow@mvista.com> writes:
> > > Also, I believe that this should be entirely subsumed by .debug_loc. 
> > > The first variable's value may no longer be available, but it has not
> > > actually gone out of scope, has it?  We should list it but claim that
> > > its value is unavailable.
> > 
> > It has actually gone out of scope. I want to use this to debug machine
> > generated IL code and the JIT may want to create local variables
> > on-the-fly. For variables which have actually been defined by a human
> > programmer, listing them and claiming that their value is no longer
> > available is IMHO the right thing to do - but I'd like to tell the
> > debugger to make a machine-generated variable disappear when it's no
> > longer used, otherwise you'd get a large number of automatic variables
> > (having numbers, not names, which makes it even more confusing to the
> > user) and only a very few of them are actually used.
> 
> What business does the JIT have actually creating local variables
> (rather than temporaries, which don't get names)?  I don't understand.

What's the difference between a local variable and a temporary variable ?

> > Btw. are there any plans to implement .debug_loc anytime soon, I need
> > this for something else ?
> 
> I believe it's in progress.

Well, this is probably the correct place to put this (and then use
DW_AT_artificial or something like this to make the variables
disappear outside their lifetime).

> On Sat, Apr 13, 2002 at 02:42:14PM +0200, Martin Baulig wrote:
> > Momchil Velikov <velco@fadata.bg> writes:
> > > One can use DT_AT_artificial to distinguish machine generated
> > > temporaries and the .debug_loc ranges to decide whether to display the
> > > variable.
> > 
> > What happens if you're outside any of the ranges listed in .debug_loc -
> > will the variable be listed or not or will this depend on DW_AT_artificial ?
> > 
> > IMHO variables which have been created by a human should always be
> > listed, but machine generated ones (since there can be a large number
> > of them) should only be listed withing their lifetime ranges.
> 
> We don't know yet, since DW_AT_artificial is currently only used for
> method arguments (and methods, but that patch is pending).  Once we've
> got .debug_loc we can decide, but this seems reasonable to me.
> 
> 
> -- 
> Daniel Jacobowitz                           Carnegie Mellon University
> MontaVista Software                         Debian GNU/Linux Developer
> 

-- 
Martin Baulig
martin@gnome.org


  reply	other threads:[~2002-04-13 19:53 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-12 16:18 Martin Baulig
2002-04-12 16:42 ` Daniel Jacobowitz
2002-04-13  4:35   ` Martin Baulig
2002-04-13  5:08     ` Momchil Velikov
2002-04-13  5:42       ` Martin Baulig
2002-04-13 11:32     ` Daniel Jacobowitz
2002-04-13 12:53       ` Martin Baulig [this message]
2002-04-13 12:59         ` Daniel Jacobowitz
2002-04-13 13:10         ` Momchil Velikov
2002-04-16  5:56 ` Daniel Berlin
2002-04-16  6:15 ` Daniel Berlin
2002-04-16 15:07 ` Jim Blandy

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=86vgav77oa.fsf@einstein.home-of-linux.org \
    --to=martin@gnome.org \
    --cc=drow@mvista.com \
    --cc=gdb@sources.redhat.com \
    --cc=velco@fadata.bg \
    /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