Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Marc Khouzam" <marc.khouzam@ericsson.com>
To: "Vladimir Prus" <vladimir@codesourcery.com>
Cc: "Nick Roberts" <nickrob@snap.net.nz>, <gdb-patches@sources.redhat.com>
Subject: RE: [PATCH:MI] Return a subset of a variable object's children
Date: Thu, 01 May 2008 18:14:00 -0000	[thread overview]
Message-ID: <6D19CA8D71C89C43A057926FE0D4ADAA04E1BD10@ecamlmw720.eamcs.ericsson.se> (raw)
In-Reply-To: <200805011954.31277.vladimir@codesourcery.com>


> > In DSF-GDB, we have a LeastRecentlyUsed queue which allows us to know which
> > varObj is the oldest (which implies it is not visible), and we can deleted
> > once we have reached our limit of 1000 varObjs.
> 
> What is the practical measured advantage of that?

I never took the time to measure the impact of this limit at different levels.
The idea is that we didn't know how many varObj GDB could handle without
loosing performance, so we chose 1000.

> > I still think that GDB should avoid having the requirement of 'deleting
> > old varObjs' toward the frontend.  
> 
> There's no concept of 'old varobjs' in MI protocol. You should delete variable
> objects as soon as whatever GUI thing you have no longer need to display the
> date the varobj corresponds to.

DSF-GDB tries to be as efficient as possible by avoiding request that go
to the backend.  Therefore, although a varObj is no longer being showed, we want
to keep it around in case it will be showed again.  Effectively, we are caching.
And our cache size is 1000 varObj.

I would appreciate your expertise on this.

> Let's clarify what varobjs are for, in my opinion. They are primarily for 
> implementing the 'variables' widget -- that shows local variables of a
> function, expressions that user wishes to be always visible, and some auxillary
> values. 

Yes, that is exactly when we use them: variables view, expressions view.

> 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.

> Speaking about arrays, I also don't understand which use cases are been considered.
> I can think about those:
> 
> 1. "Oops". User, without much though, opens an item in variable tree. The
> item happens to be array of 10000 elements. We don't want UI to block until those
> elements are fetched -- we want to show a few (say 10) and allow the user to get
> some more in case he really wanted to see something.
> 
> 2. "Subset". Probably, there's some local subset of array elements that the user
> wants to look at. I think in that case, we should have a way to create only children
> in the range that user is interested in. And I think Nick's patch is just fine.

Now that I think about it, isn't there a mechanism to -var-create a slice of an array?
-var-create - * myArray@10 
The frontend would then manage multiple varObjs representing the slices of an array.
The CDT does that.
DSF does not do that because Pawel came up with a simpler idea (and because I wasn't
aware of the slice thing at the time; no doc on that slice thing, right?):
for arrays, we do not use -var-list-children, but instead, we -var-create each child
ourselves, when needed.

So, in our case, we have managed to work around large arrays.
However, I saw Nick's proposal as valuable because it applies to all structs and not
just arrays.  Also, it avoids the frontend having to have special logic for arrays.

> 3. "Data analysis". User actually wants to make some sense of all 10000 element.
> Maybe, well, draw a chart. Or just look at the data. The data is integer, or some
> other atomic type. Then, either some specialized widget, or merely the memory view,
> is quite adequate.
> 
> What I don't see as a valid use case is one where:
> 
> 1. The size of array is too large to keep all varobj always created.

I'm not sure what you mean here.  Before Nick's patch, issuing -var-list-children
on a large array would create a lot of varObjs.  In our case, it would have
filled up our varObj cache, although we would only be showing very few of the
array elements.

> 2. User would like to just scroll though all the array items, without
> clear intentions.

This is probably not a valid use case... although user behavior, even when dumb :-)
should not break the frontend.

But you got me thinking now... Maybe var-create using with an array slice is all we
need for dealing with a large array?

Marc























  reply	other threads:[~2008-05-01 18:14 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 [this message]
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
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=6D19CA8D71C89C43A057926FE0D4ADAA04E1BD10@ecamlmw720.eamcs.ericsson.se \
    --to=marc.khouzam@ericsson.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=nickrob@snap.net.nz \
    --cc=vladimir@codesourcery.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