Use varobj_is_dynamic_p more widely
authorYao Qi <yao@codesourcery.com>
Sat, 23 Nov 2013 08:05:58 +0000 (16:05 +0800)
committerYao Qi <yao@codesourcery.com>
Thu, 12 Jun 2014 07:27:42 +0000 (15:27 +0800)
Use varobj_is_dynamic_p more widely so that the callers of
varobj_is_dynamic_p are unchanged when we add available-children-only
stuff in varobj_is_dynamic_p.

gdb:

2014-06-12  Yao Qi  <yao@codesourcery.com>

* varobj.c (varobj_get_num_children): Call
varobj_is_dynamic_p.
(varobj_list_children): Likewise.
(varobj_update): Likewise.  Update comments.

gdb/ChangeLog
gdb/varobj.c

index 55146f40ac6f48030f2ad6976890b7ee3ee4a560..d3bd642dc75257e8303b41aa58edabb19e5fef24 100644 (file)
@@ -1,3 +1,10 @@
+2014-06-12  Yao Qi  <yao@codesourcery.com>
+
+       * varobj.c (varobj_get_num_children): Call
+       varobj_is_dynamic_p.
+       (varobj_list_children): Likewise.
+       (varobj_update): Likewise.  Update comments.
+
 2014-06-12  Yao Qi  <yao@codesourcery.com>
 
        * varobj.c (varobj_pretty_printed_p): Rename to ...
index 94050c6ebd5011680a83b9c9dd974e7d50585fa5..8f95cc2c76c7d31d3cf5a4ef33f0740ec142eca4 100644 (file)
@@ -895,7 +895,7 @@ varobj_get_num_children (struct varobj *var)
 {
   if (var->num_children == -1)
     {
-      if (var->dynamic->pretty_printer != NULL)
+      if (varobj_is_dynamic_p (var))
        {
          int dummy;
 
@@ -922,7 +922,7 @@ varobj_list_children (struct varobj *var, int *from, int *to)
 
   var->dynamic->children_requested = 1;
 
-  if (var->dynamic->pretty_printer != NULL)
+  if (varobj_is_dynamic_p (var))
     {
       /* This, in theory, can result in the number of children changing without
         frontend noticing.  But well, calling -var-list-children on the same
@@ -1724,10 +1724,9 @@ varobj_update (struct varobj **varp, int explicit)
            }
        }
 
-      /* We probably should not get children of a varobj that has a
-        pretty-printer, but for which -var-list-children was never
-        invoked.  */
-      if (v->dynamic->pretty_printer != NULL)
+      /* We probably should not get children of a dynamic varobj, but
+        for which -var-list-children was never invoked.  */
+      if (varobj_is_dynamic_p (v))
        {
          VEC (varobj_p) *changed = 0, *type_changed = 0, *unchanged = 0;
          VEC (varobj_p) *new = 0;