mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-26 09:08:59 +00:00
Finish constification of varobj interface
This completes the constification of the struct varobj pointers in the
lang_varobj_ops interface partially done in
b09e2c591f. As suggested by Pedro,
varobj_get_path_expr casts away the const to assign the "mutable" struct
member.
gdb/ChangeLog:
* ada-varobj.c (ada_name_of_child): Constify parent.
(ada_path_expr_of_child): Same.
(ada_value_of_child): Same.
(ada_type_of_child): Same.
* c-varobj.c (c_is_path_expr_parent): Same.
(c_describe_child): Same.
(c_name_of_child): Same.
(c_value_of_child): Same.
(c_type_of_child): Same.
(cplus_number_of_children): Same.
(cplus_describe_child): Constify var.
(cplus_name_of_child): Constify parent.
(cplus_value_of_child): Same.
(cplus_type_of_child): Same.
* jv-varobj.c (java_name_of_child): Same.
(java_value_of_child): Same.
(java_type_of_child): Same.
* varobj.c (value_of_child): Same.
(varobj_default_is_path_expr_parent): Constify var, parent and return
value.
(varobj_get_path_expr): Constify var, modify path_expr through
mutable_var.
(install_new_value): Constify parent.
(value_of_child): Constify parent.
* varobj.h (struct varobj): Constify parent.
(struct lang_varobj_ops): Constify name_of_child, value_of_child and
type_of_child.
(varobj_get_path_expr): Constify var.
(varobj_get_path_expr_parent): Constify var and return value.
This commit is contained in:
@@ -918,7 +918,7 @@ ada_name_of_variable (const struct varobj *parent)
|
||||
}
|
||||
|
||||
static char *
|
||||
ada_name_of_child (struct varobj *parent, int index)
|
||||
ada_name_of_child (const struct varobj *parent, int index)
|
||||
{
|
||||
return ada_varobj_get_name_of_child (parent->value, parent->type,
|
||||
parent->name, index);
|
||||
@@ -927,7 +927,7 @@ ada_name_of_child (struct varobj *parent, int index)
|
||||
static char*
|
||||
ada_path_expr_of_child (const struct varobj *child)
|
||||
{
|
||||
struct varobj *parent = child->parent;
|
||||
const struct varobj *parent = child->parent;
|
||||
const char *parent_path_expr = varobj_get_path_expr (parent);
|
||||
|
||||
return ada_varobj_get_path_expr_of_child (parent->value,
|
||||
@@ -938,14 +938,14 @@ ada_path_expr_of_child (const struct varobj *child)
|
||||
}
|
||||
|
||||
static struct value *
|
||||
ada_value_of_child (struct varobj *parent, int index)
|
||||
ada_value_of_child (const struct varobj *parent, int index)
|
||||
{
|
||||
return ada_varobj_get_value_of_child (parent->value, parent->type,
|
||||
parent->name, index);
|
||||
}
|
||||
|
||||
static struct type *
|
||||
ada_type_of_child (struct varobj *parent, int index)
|
||||
ada_type_of_child (const struct varobj *parent, int index)
|
||||
{
|
||||
return ada_varobj_get_type_of_child (parent->value, parent->type,
|
||||
index);
|
||||
|
||||
Reference in New Issue
Block a user