Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Vladimir Prus <vladimir@codesourcery.com>
To: gdb-patches@sources.redhat.com
Subject: RE: [PATCH:MI] Return a subset of a variable object's children
Date: Sun, 11 May 2008 17:45:00 -0000	[thread overview]
Message-ID: <g071hl$cmj$1@ger.gmane.org> (raw)
In-Reply-To: <6D19CA8D71C89C43A057926FE0D4ADAA04E1BD13@ecamlmw720.eamcs.ericsson.se>

Marc Khouzam wrote:

>> If a variable is deleted from variables tree (because you left the scope
>> where that variable is defined), then you should delete variable object.
>> There's no reliable way to detect that exactly same variable is in scope
>> again and must be shown, so no reuse is possible.
> 
> We chose a more passive approach.  The frontend relies entirely on GDB to
> know if a varObj has gone out-of-scope.  Since GDB reports this
> only if the varObj is given the var-update command, we don't get to know
> it very often, because we only use the var-update command for varObj we want
> to know the value of.
> I believe an example is in order :-)
> 
> Say you have local variable bar in method foo().
> We create a varObj for bar.  Once we return from foo(), there is no longer
> a local variable bar, so we don't send a -var-update for it, which in turn
> means we don't realize that it is out-of-scope and we don't delete it.
> 
> What this implies in the end is that we only delete a varObj if our cache
> is full.  The only exception to this rule is when the expression of a
> variable object is re-used which will trigger a var-update, which will
> show that the old varObj is out-of-scope (so we create a new one.)
> (if after returning from foo(), there is another local variable bar)

That does not sound like an ideal approach, because given that GDB knows 
for sure which variable objects are in scope, and which are not, you are
using some heuristics to to guess that, and it will never be 100% ideal.
Having said that, while GDB knows everything, MI interfaces are somewhat
lacking as far as local variables are concerned. I plan to design command(s)
that allow to easily and reliably track local variables, and will post those.

>> > > There are natural scalability bounds in the UI -- if there are no
>> > > arrays involved, and you try to show 1000 items (backed by 1000 variable objects),
>> > > the UI is already useless. GDB is not the problem here.
>> > 
>> > Right, but for us the 1000 varObj are not meant to all be displayed at once
>> > but are a caching system.
>> 
>> I'm still not sure what you mean -- you mean that a variable object is not shown
>> in any widget, but only is stored in the cache? What is the key of the cache?
> 
> Ah yes, the key of the cache.  That gave me a big headache :-)
> It is a object containing: the expression for the varObj, the thread it is part of,
> and the frame level.
> If the same expression (variable name) is used in the same thread at the same frame
> level, then we first think it is the same varObj and we use -var-update; we then
> get an out-of-scope and we delete the old varObj and create a new one.

I see. I hope this approach won't be necessary soon (though only if you're willing
to conditionalize the logic in gdb version).

- Volodya



  reply	other threads:[~2008-05-11 14:58 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-27 15:34 Nick Roberts
2008-04-29 15:58 ` Marc Khouzam
2008-04-30  7:02   ` Nick Roberts
2008-04-30  9:20     ` Vladimir Prus
2008-04-30  9:25       ` Nick Roberts
2008-04-30  9:39         ` Vladimir Prus
2008-04-30 16:29           ` Marc Khouzam
2008-05-01 15:56             ` Vladimir Prus
2008-05-01 17:29               ` Marc Khouzam
2008-05-01 12:15           ` Nick Roberts
2008-05-10 14:45             ` Nick Roberts
2008-05-28 19:15               ` Vladimir Prus
2008-05-29 12:01                 ` Nick Roberts
2008-04-30 16:22         ` Marc Khouzam
2008-05-01 15:54           ` Vladimir Prus
2008-05-01 18:14             ` Marc Khouzam
2008-05-01 18:40               ` Vladimir Prus
2008-05-01 20:49                 ` Daniel Jacobowitz
2008-05-01 23:38                   ` Nick Roberts
2008-05-02  0:58                 ` Marc Khouzam
2008-05-11 17:45                   ` Vladimir Prus [this message]
2008-04-30 10:47       ` André Pönitz
2008-04-30 12:20         ` Vladimir Prus
2008-04-30 12:53           ` André Pönitz
2008-04-30 13:11             ` Vladimir Prus
2008-04-30 12:44         ` Nick Roberts
     [not found]           ` <200804301244.55116.apoenitz@trolltech.com>
2008-04-30 13:16             ` André Pönitz
2008-05-01  6:27               ` Nick Roberts
2008-05-05 11:46                 ` André Pönitz
2008-04-30 14:59     ` Marc Khouzam
2008-05-01 12:06       ` Nick Roberts
2008-05-01 14:22         ` Marc Khouzam
2008-05-01 20:41     ` Daniel Jacobowitz
2008-04-30  8:59 ` Vladimir Prus

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='g071hl$cmj$1@ger.gmane.org' \
    --to=vladimir@codesourcery.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