From: Jim Blandy <jimb@codesourcery.com>
To: Jim Ingham <jingham@apple.com>
Cc: Marc Gauthier <marc@tensilica.com>,
Ross Morley <ross@tensilica.com>,
Nick Roberts <nickrob@snap.net.nz>,
Maxim Grigoriev <maxim@tensilica.com>,
gdb@sourceware.org, Pete MacLiesh <pmac@tensilica.com>
Subject: Re: Understanding GDB frames
Date: Wed, 23 May 2007 21:45:00 -0000 [thread overview]
Message-ID: <m3d50rrz7o.fsf@codesourcery.com> (raw)
In-Reply-To: <20070522183603.GA31229@caradoc.them.org> (Daniel Jacobowitz's message of "Tue, 22 May 2007 14:36:03 -0400")
Daniel Jacobowitz <drow@false.org> writes:
> On Tue, May 22, 2007 at 11:32:41AM -0700, Jim Ingham wrote:
>> I don't see what the bad effect of not destroying the varobj if the frame id is
>> identical is. You might get an errant "value changed" notification. Other than
>> that, I can't see what you would be gaining.
>>
>> If we're going to do some extra work to make sure we mark variables out of
>> scope when their frames are exited, we should get something real out of it. So
>> far it seems the benefit is only theoretical.
>
> Sure. I'm not seriously proposing we do that extra work, though I did
> think about it. But what we do need is to clarify our semantics so
> that front ends know what to expect. Should varobjs be destroyed when
> we leave and re-enter a function? If the answer is "maybe", then that
> is confusing enough to deserve some more explanation :-)
Varobjs were originally introduced to improve the performance of
GUI's. If I remember right, the win came from reducing round trips,
and perhaps from avoiding reparsing expressions. I think that's still
their reason for existence.
So varobjs should work in whatever way is most helpful for the GUIs
that use them. Implementing behavior that seems clean at the GDB
level, but that makes GUIs do work that negates varobjs' original
advantages, is a step backwards. Deleting varobjs when they go out of
scope, if the GUI wants to keep its display alive for the next time
that block comes back into scope, is unhelpful.
What behavior does Eclipse (say) want?
That is, if I add a variable 'x' to my display list, and the currently
selected frame is for a function 'f' with a local variable 'x', does
Eclipse want that display:
a) to be removed and forgotten when that particular frame is popped?
b) to be displayed and updated whenever a frame of 'f' is current, and
greyed out otherwise? (This is what you'd want if you were going
through various hits of a breakpoint looking at 'x' to recognize the
hit you care about.)
c) to just show whatever 'x' happens to be in scope in the current
frame?
GDB's varobjs currently implement b), which is what I'd think most
GUIs would want:
$ cat vo.c
int
foo (int x)
{
return x + 1;
}
int
bar (int x)
{
return x;
}
int
main (int argc, char **argv)
{
foo (10);
foo (20);
bar (30);
return 0;
}
If I set breakpoints in foo and bar, run to the first hit in foo, and
create a varobj for x, then the varobj is marked:
- out of scope when I return to main,
- back in scope when I re-enter foo,
- out of scope when I return to main a second time, and
- still out of scope when I enter bar.
So the frame argument to -var-create is used to identify a scope, not
to tie the varobj to that specific frame. Which I think is the
behavior that makes life easiest for GUIs.
next prev parent reply other threads:[~2007-05-23 21:45 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-21 22:24 Maxim Grigoriev
2007-05-21 23:28 ` Ross Morley
2007-05-22 2:05 ` Nick Roberts
2007-05-22 2:31 ` Daniel Jacobowitz
2007-05-22 2:51 ` Nick Roberts
2007-05-22 10:58 ` Daniel Jacobowitz
2007-05-22 8:40 ` Ross Morley
2007-05-22 16:10 ` Marc Gauthier
2007-05-22 16:36 ` Daniel Jacobowitz
2007-05-22 18:14 ` Vladimir Prus
2007-05-22 18:33 ` Jim Ingham
2007-05-22 18:36 ` Daniel Jacobowitz
2007-05-23 21:45 ` Jim Blandy [this message]
2007-05-22 17:20 ` Ross Morley
2007-05-22 20:24 ` Nick Roberts
2007-05-22 21:12 ` Maxim Grigoriev
2007-05-22 1:40 ` Joel Brobecker
2007-05-22 2:29 ` Daniel Jacobowitz
2007-05-22 18:37 ` Jim Blandy
2007-05-22 19:17 ` Maxim Grigoriev
2007-05-22 20:25 ` Nick Roberts
2007-05-22 20:33 ` Ross Morley
2007-05-22 20:45 ` Maxim Grigoriev
2007-05-22 21:26 ` Nick Roberts
2007-05-23 7:00 ` Eli Zaretskii
2007-05-23 10:48 ` Daniel Jacobowitz
2007-05-23 12:44 ` Eli Zaretskii
2007-05-22 23:56 ` Jim Blandy
2007-05-23 1:01 ` Maxim Grigoriev
2007-05-23 2:24 ` Daniel Jacobowitz
2007-05-23 16:37 ` Maxim Grigoriev
2007-05-23 0:05 ` Jim Blandy
2007-05-23 0:17 ` Daniel Jacobowitz
2007-05-23 0:17 ` Ross Morley
2007-05-23 0:32 ` Jim Blandy
2007-05-23 2:24 ` Ross Morley
2007-05-23 21:52 ` Jim Blandy
2007-05-24 0:05 ` Ross Morley
2007-05-24 1:24 ` Ross Morley
2007-05-24 21:56 ` 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=m3d50rrz7o.fsf@codesourcery.com \
--to=jimb@codesourcery.com \
--cc=gdb@sourceware.org \
--cc=jingham@apple.com \
--cc=marc@tensilica.com \
--cc=maxim@tensilica.com \
--cc=nickrob@snap.net.nz \
--cc=pmac@tensilica.com \
--cc=ross@tensilica.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