This is the mail archive of the
archer@sourceware.org
mailing list for the Archer project.
[python] don't report -1 varobj children
- From: Tom Tromey <tromey at redhat dot com>
- To: Project Archer <archer at sourceware dot org>
- Date: Tue, 18 Aug 2009 12:58:21 -0600
- Subject: [python] don't report -1 varobj children
- Reply-to: tromey at redhat dot com
I'm checking this in on the python branch.
A dynamic varobj should never report that it has -1 children.
Tom
2009-08-18 Tom Tromey <tromey@redhat.com>
* varobj.c (varobj_get_num_children): Don't return -1 to the
caller.
diff --git a/gdb/varobj.c b/gdb/varobj.c
index f2a4ab6..f0ad1ac 100644
--- a/gdb/varobj.c
+++ b/gdb/varobj.c
@@ -1052,11 +1052,20 @@ update_dynamic_varobj_children (struct varobj *var,
int
varobj_get_num_children (struct varobj *var)
{
+ int result = var->num_children;
+
if (var->num_children == -1)
{
- int changed;
- if (!var->pretty_printer)
- var->num_children = number_of_children (var);
+ if (var->pretty_printer)
+ {
+ /* If we have a dynamic varobj, don't report -1 children. */
+ result = 0;
+ }
+ else
+ {
+ var->num_children = number_of_children (var);
+ result = var->num_children;
+ }
}
return var->num_children;