+2018-09-10 Xavier Roirand <roirand@adacore.com>
+
+ * ada-lang.c (ada_is_access_to_unconstrained_array): Remove static
+ declaration.
+ * ada-lang.h: add ada_is_access_to_unconstrained_array prototype.
+ * ada-varobj.c (ada_varobj_get_number_of_children,
+ ada_varobj_describe_child, ada_value_is_changeable_p): Cleanup code.
+
2018-09-10 Xavier Roirand <roirand@adacore.com>
* ada-valprint.c (ada_value_print): Use type instead of
struct value *ada_convert_actual (struct value *actual,
struct type *formal_type0);
+extern bool ada_is_access_to_unconstrained_array (struct type *type);
+
extern struct value *ada_value_subscript (struct value *, int,
struct value **);
/* A typedef to an array descriptor in fact represents a pointer
to an unconstrained array. These types always have one child
(the unconstrained array). */
- if (ada_is_array_descriptor_type (parent_type)
- && TYPE_CODE (parent_type) == TYPE_CODE_TYPEDEF)
+ if (ada_is_access_to_unconstrained_array (parent_type))
return 1;
if (TYPE_CODE (parent_type) == TYPE_CODE_ARRAY)
if (child_path_expr)
*child_path_expr = std::string ();
- if (ada_is_array_descriptor_type (parent_type)
- && TYPE_CODE (parent_type) == TYPE_CODE_TYPEDEF)
+ if (ada_is_access_to_unconstrained_array (parent_type))
{
ada_varobj_describe_ptr_child (parent_value, parent_type,
parent_name, parent_path_expr,
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)
+ if (ada_is_access_to_unconstrained_array (type))
{
/* This is in reality a pointer to an unconstrained array.
its value is changeable. */