aboutsummaryrefslogtreecommitdiff
path: root/gdb/ada-varobj.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2018-04-03 18:15:13 -0600
committerTom Tromey <tom@tromey.com>2018-04-06 15:44:48 -0600
commitb4d61099ba840824fd0aac9800403f6278476347 (patch)
treee2424dd947930be814dfb299fd671de6bd16037e /gdb/ada-varobj.c
parent9b5587295bbc57e5e0453b659e24d7c2b504b894 (diff)
downloadgdb-b4d61099ba840824fd0aac9800403f6278476347.zip
gdb-b4d61099ba840824fd0aac9800403f6278476347.tar.gz
gdb-b4d61099ba840824fd0aac9800403f6278476347.tar.bz2
Change varobj to use value_ref_ptr
This changes varobj to use value_ref_ptr, allowing the removal of some manual reference count management. gdb/ChangeLog 2018-04-06 Tom Tromey <tom@tromey.com> * varobj.h (struct varobj) <value>: Now a value_ref_ptr. * varobj.c (varobj_set_display_format, varobj_set_value) (install_default_visualizer, construct_visualizer) (install_new_value, ~varobj, varobj_get_value_type) (my_value_of_variable, varobj_editable_p): Update. * c-varobj.c (c_describe_child, c_value_of_variable) (cplus_number_of_children, cplus_describe_child): Update. * ada-varobj.c (ada_number_of_children, ada_name_of_child) (ada_path_expr_of_child, ada_value_of_child, ada_type_of_child) (ada_value_of_variable, ada_value_is_changeable_p): Update.
Diffstat (limited to 'gdb/ada-varobj.c')
-rw-r--r--gdb/ada-varobj.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/gdb/ada-varobj.c b/gdb/ada-varobj.c
index 1257ee8..6dafe47 100644
--- a/gdb/ada-varobj.c
+++ b/gdb/ada-varobj.c
@@ -872,7 +872,7 @@ ada_varobj_get_value_of_variable (struct value *value,
static int
ada_number_of_children (const struct varobj *var)
{
- return ada_varobj_get_number_of_children (var->value, var->type);
+ return ada_varobj_get_number_of_children (var->value.get (), var->type);
}
static std::string
@@ -884,7 +884,7 @@ ada_name_of_variable (const struct varobj *parent)
static std::string
ada_name_of_child (const struct varobj *parent, int index)
{
- return ada_varobj_get_name_of_child (parent->value, parent->type,
+ return ada_varobj_get_name_of_child (parent->value.get (), parent->type,
parent->name.c_str (), index);
}
@@ -894,7 +894,7 @@ ada_path_expr_of_child (const struct varobj *child)
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,
+ return ada_varobj_get_path_expr_of_child (parent->value.get (),
parent->type,
parent->name.c_str (),
parent_path_expr,
@@ -904,14 +904,14 @@ ada_path_expr_of_child (const struct varobj *child)
static struct value *
ada_value_of_child (const struct varobj *parent, int index)
{
- return ada_varobj_get_value_of_child (parent->value, parent->type,
+ return ada_varobj_get_value_of_child (parent->value.get (), parent->type,
parent->name.c_str (), index);
}
static struct type *
ada_type_of_child (const struct varobj *parent, int index)
{
- return ada_varobj_get_type_of_child (parent->value, parent->type,
+ return ada_varobj_get_type_of_child (parent->value.get (), parent->type,
index);
}
@@ -923,7 +923,8 @@ ada_value_of_variable (const struct varobj *var,
varobj_formatted_print_options (&opts, format);
- return ada_varobj_get_value_of_variable (var->value, var->type, &opts);
+ return ada_varobj_get_value_of_variable (var->value.get (), var->type,
+ &opts);
}
/* Implement the "value_is_changeable_p" routine for Ada. */
@@ -931,7 +932,8 @@ ada_value_of_variable (const struct varobj *var,
static bool
ada_value_is_changeable_p (const struct varobj *var)
{
- struct type *type = var->value ? value_type (var->value) : var->type;
+ struct type *type = (var->value != nullptr
+ ? value_type (var->value.get ()) : var->type);
if (ada_is_array_descriptor_type (type)
&& TYPE_CODE (type) == TYPE_CODE_TYPEDEF)