+2014-06-12 Pedro Alves <pedro@codesourcery.com>
+ Yao Qi <yao@codesourcery.com>
+
+ * varobj.c: Remove "#if HAVE_PYTHON" and "#endif".
+ (varobj_get_iterator): Wrap up code for pretty-printer by
+ "#if HAVE_PYTHON" and "#endif".
+ (update_dynamic_varobj_children): Likewise.
+
2014-06-12 Pedro Alves <pedro@codesourcery.com>
Yao Qi <yao@codesourcery.com>
static int is_root_p (struct varobj *var);
-#if HAVE_PYTHON
-
static struct varobj *varobj_add_child (struct varobj *var,
struct varobj_item *item);
-#endif /* HAVE_PYTHON */
-
/* Private data */
/* Mappings of varobj_display_formats enums to gdb's format codes. */
}
}
-#if HAVE_PYTHON
-
/* A helper for update_dynamic_varobj_children that installs a new
child when needed. */
}
}
+#if HAVE_PYTHON
+
static int
dynamic_varobj_has_child_method (struct varobj *var)
{
do_cleanups (back_to);
return result;
}
+#endif
/* A factory for creating dynamic varobj's iterators. Returns an
iterator object suitable for iterating over VAR's children. */
static struct varobj_iter *
varobj_get_iterator (struct varobj *var)
{
+#if HAVE_PYTHON
if (var->dynamic->pretty_printer)
return py_varobj_get_iterator (var, var->dynamic->pretty_printer);
+#endif
gdb_assert_not_reached (_("\
requested an iterator from a non-dynamic varobj"));
var->saved_item = NULL;
}
}
-#endif
static int
update_dynamic_varobj_children (struct varobj *var,
int from,
int to)
{
-#if HAVE_PYTHON
int i;
*cchanged = 0;
var->num_children = VEC_length (varobj_p, var->children);
return 1;
-#else
- gdb_assert_not_reached ("should never be called if Python is not enabled");
-#endif
}
int
return var->children;
}
-#if HAVE_PYTHON
-
static struct varobj *
varobj_add_child (struct varobj *var, struct varobj_item *item)
{
return v;
}
-#endif /* HAVE_PYTHON */
-
/* Obtain the type of an object Variable as a string similar to the one gdb
prints on the console. */