Remove #if HAVE_PYTHON
This patch removes some unnecessary "#if HAVE_PYTHON" so that more code is generalized. gdb: 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.
This commit is contained in:
parent
827f100cee
commit
576ea0910f
|
@ -1,3 +1,11 @@
|
||||||
|
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>
|
2014-06-12 Pedro Alves <pedro@codesourcery.com>
|
||||||
Yao Qi <yao@codesourcery.com>
|
Yao Qi <yao@codesourcery.com>
|
||||||
|
|
||||||
|
|
20
gdb/varobj.c
20
gdb/varobj.c
|
@ -212,13 +212,9 @@ static char *my_value_of_variable (struct varobj *var,
|
||||||
|
|
||||||
static int is_root_p (struct varobj *var);
|
static int is_root_p (struct varobj *var);
|
||||||
|
|
||||||
#if HAVE_PYTHON
|
|
||||||
|
|
||||||
static struct varobj *varobj_add_child (struct varobj *var,
|
static struct varobj *varobj_add_child (struct varobj *var,
|
||||||
struct varobj_item *item);
|
struct varobj_item *item);
|
||||||
|
|
||||||
#endif /* HAVE_PYTHON */
|
|
||||||
|
|
||||||
/* Private data */
|
/* Private data */
|
||||||
|
|
||||||
/* Mappings of varobj_display_formats enums to gdb's format codes. */
|
/* Mappings of varobj_display_formats enums to gdb's format codes. */
|
||||||
|
@ -701,8 +697,6 @@ varobj_restrict_range (VEC (varobj_p) *children, int *from, int *to)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if HAVE_PYTHON
|
|
||||||
|
|
||||||
/* A helper for update_dynamic_varobj_children that installs a new
|
/* A helper for update_dynamic_varobj_children that installs a new
|
||||||
child when needed. */
|
child when needed. */
|
||||||
|
|
||||||
|
@ -747,6 +741,8 @@ install_dynamic_child (struct varobj *var,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if HAVE_PYTHON
|
||||||
|
|
||||||
static int
|
static int
|
||||||
dynamic_varobj_has_child_method (struct varobj *var)
|
dynamic_varobj_has_child_method (struct varobj *var)
|
||||||
{
|
{
|
||||||
|
@ -762,6 +758,7 @@ dynamic_varobj_has_child_method (struct varobj *var)
|
||||||
do_cleanups (back_to);
|
do_cleanups (back_to);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* A factory for creating dynamic varobj's iterators. Returns an
|
/* A factory for creating dynamic varobj's iterators. Returns an
|
||||||
iterator object suitable for iterating over VAR's children. */
|
iterator object suitable for iterating over VAR's children. */
|
||||||
|
@ -769,8 +766,10 @@ dynamic_varobj_has_child_method (struct varobj *var)
|
||||||
static struct varobj_iter *
|
static struct varobj_iter *
|
||||||
varobj_get_iterator (struct varobj *var)
|
varobj_get_iterator (struct varobj *var)
|
||||||
{
|
{
|
||||||
|
#if HAVE_PYTHON
|
||||||
if (var->dynamic->pretty_printer)
|
if (var->dynamic->pretty_printer)
|
||||||
return py_varobj_get_iterator (var, var->dynamic->pretty_printer);
|
return py_varobj_get_iterator (var, var->dynamic->pretty_printer);
|
||||||
|
#endif
|
||||||
|
|
||||||
gdb_assert_not_reached (_("\
|
gdb_assert_not_reached (_("\
|
||||||
requested an iterator from a non-dynamic varobj"));
|
requested an iterator from a non-dynamic varobj"));
|
||||||
|
@ -788,7 +787,6 @@ varobj_clear_saved_item (struct varobj_dynamic *var)
|
||||||
var->saved_item = NULL;
|
var->saved_item = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
update_dynamic_varobj_children (struct varobj *var,
|
update_dynamic_varobj_children (struct varobj *var,
|
||||||
|
@ -801,7 +799,6 @@ update_dynamic_varobj_children (struct varobj *var,
|
||||||
int from,
|
int from,
|
||||||
int to)
|
int to)
|
||||||
{
|
{
|
||||||
#if HAVE_PYTHON
|
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
*cchanged = 0;
|
*cchanged = 0;
|
||||||
|
@ -891,9 +888,6 @@ update_dynamic_varobj_children (struct varobj *var,
|
||||||
var->num_children = VEC_length (varobj_p, var->children);
|
var->num_children = VEC_length (varobj_p, var->children);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
#else
|
|
||||||
gdb_assert_not_reached ("should never be called if Python is not enabled");
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
@ -970,8 +964,6 @@ varobj_list_children (struct varobj *var, int *from, int *to)
|
||||||
return var->children;
|
return var->children;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if HAVE_PYTHON
|
|
||||||
|
|
||||||
static struct varobj *
|
static struct varobj *
|
||||||
varobj_add_child (struct varobj *var, struct varobj_item *item)
|
varobj_add_child (struct varobj *var, struct varobj_item *item)
|
||||||
{
|
{
|
||||||
|
@ -983,8 +975,6 @@ varobj_add_child (struct varobj *var, struct varobj_item *item)
|
||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* HAVE_PYTHON */
|
|
||||||
|
|
||||||
/* Obtain the type of an object Variable as a string similar to the one gdb
|
/* Obtain the type of an object Variable as a string similar to the one gdb
|
||||||
prints on the console. */
|
prints on the console. */
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue