This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
varobjs "in_scope"
- From: Vladimir Prus <vladimir at codesourcery dot com>
- To: gdb at sources dot redhat dot com
- Date: Sun, 25 Mar 2007 14:31:14 +0300
- Subject: varobjs "in_scope"
Hi,
it looks like we're a little bit inconsistent in how
we deal with varobjs whose value cannot be evaluated.
In some cases, MI returns "" as a value of varobjs
that cannot be evaluated. In some cases MI
returns in_scope="false".
For example, if you create a varobj
for "*p", and the program changes p to NULL,
and you issue -var-update, you get:
-var-update V
^done,changelist=[{name="V",in_scope="true",type_changed="false"}]
(gdb)
-var-evaluate-expression V
^done,value=""
If you create a varobj for **p, and the program changes p
to NULL, and you issue -var-update, you get:
-var-update V
^done,changelist=[{name="V",in_scope="false"}]
(gdb)
This difference in behaviour does not seem reasonable.
I suggest that we either:
1. Completely kill the "in_scope" attribute. To represent current
in_scope="invalid", introduce some other attribute, like "valid".
2. Keep in_scope for the cases where either the frame varobj
is bound too no longer exists, or the expression corresponding
to varobj cannot be reparsed. Use value="" for the cases
where expression can be reparsed, but the value cannot be
evaluated.
Comments?
- Volodya