From: Nick Roberts <nickrob@snap.net.nz>
To: Daniel Jacobowitz <drow@false.org>
Cc: gdb-patches@sourceware.org
Subject: Re: [MI] lvalues and variable_editable
Date: Wed, 04 Jul 2007 03:04:00 -0000 [thread overview]
Message-ID: <18059.3627.269075.427280@kahikatea.snap.net.nz> (raw)
In-Reply-To: <20070703161533.GF2868@caradoc.them.org>
> > Here are two experimental patches:
> >
> > 1) varobj.c: Test if the value of variable object is an lvalue. I think
> > this can only occur for root values.
>
> I'm still a bit confused but I think this is because I read "lvalue"
> and think of the C language meaning. An lvalue is something which can
> occur on the left hand side of an assignment. So it can happen for
> children too, for instance.
AFAIK lvalue isn't a language specific context. Here's how to specify an
lvalue for a root variable:
-var-create - * "i1 + i2"
Can you give an example of how you would specify an lvalue for children?
> Right now a value is "changeable" unless it is a fake child
> (e.g. "public"), a struct, a union, or an array. This makes some
> sense since the value we print out for those cases is not useful for
> editing. For instance "{...}". Their children will, I believe, be
> changeable.
>
> A value is editable in C unless it is a struct, union, array,
> function, or method. C++ adds the fake access children again.
Yes. varobj_value_is_changeable_p uses the test "if (CPLUS_FAKE_CHILD (var))"
in a language independent way, so variable_editable could also.
> So the only things which are editable but not changeable are functions
> and methods. That doesn't seem like a useful distinction.
>
> Back in revision 1.1, fake children and structs and unions were not
> changeable. Those and arrays, functions, methods, and members were
> not editable. That doesn't make considerably more sense to me either.
>
> The difference in usage seems to be that we forbid attempts to modify
> non-editable variables, and we omit reporting changes for
> non-changeable variables.
>
> > It would seem sensible to define variable_editable using
> > varobj_value_is_changeable_p and I don't think language dependent versions
> > aren't needed.
>
> I agree. But is there anything which should be one and not the other?
My initial premise was: "a value is only changeable but not editable when
it's an lvalue."
> Maybe we can dispense with changeable entirely.
I don't think so. The attribute changeable tells GDB whether it needs to check
if the value has changed. The attribute editable tells the frontend whether the
user should be allowed to try to edit the value, which was the source of Sascha
Radike's bug report (BUG: MI reporting wrong attributes for casted variables).
--
Nick http://www.inet.net.nz/~nickrob
next prev parent reply other threads:[~2007-07-04 3:04 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-26 11:46 Nick Roberts
2007-07-03 16:16 ` Daniel Jacobowitz
2007-07-04 3:04 ` Nick Roberts [this message]
2007-07-04 3:11 ` Nick Roberts
2007-07-04 3:14 ` Daniel Jacobowitz
2007-07-04 3:35 ` Nick Roberts
2007-07-04 15:57 ` Daniel Jacobowitz
2007-07-09 5:51 ` Nick Roberts
2007-07-09 12:05 ` Daniel Jacobowitz
2007-07-09 12:38 ` Nick Roberts
2007-07-10 1:45 ` Daniel Jacobowitz
2007-07-09 12:46 ` Vladimir Prus
2007-07-09 13:13 ` Vladimir Prus
2007-07-10 0:49 ` Nick Roberts
2007-07-10 17:14 ` Vladimir Prus
2007-07-11 1:26 ` Nick Roberts
2007-07-11 6:46 ` Vladimir Prus
2007-07-11 7:10 ` Vladimir Prus
2007-07-11 11:57 ` Nick Roberts
2007-07-11 13:09 ` 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=18059.3627.269075.427280@kahikatea.snap.net.nz \
--to=nickrob@snap.net.nz \
--cc=drow@false.org \
--cc=gdb-patches@sourceware.org \
/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