/* varobj support for Ada.
- Copyright (C) 2012-2013 Free Software Foundation, Inc.
+ Copyright (C) 2012-2014 Free Software Foundation, Inc.
This file is part of GDB.
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "ada-varobj.h"
#include "ada-lang.h"
#include "varobj.h"
#include "language.h"
it allows the code to use the type without having to worry about
it being set or not. It makes the code clearer. */
+static int ada_varobj_get_number_of_children (struct value *parent_value,
+ struct type *parent_type);
+
/* A convenience function that decodes the VALUE_PTR/TYPE_PTR couple:
If there is a value (*VALUE_PTR not NULL), then perform the decoding
using it, and compute the associated type from the resulting value.
&& !ada_is_array_descriptor_type (TYPE_TARGET_TYPE (*type))
&& !ada_is_constrained_packed_array_type (TYPE_TARGET_TYPE (*type)))
ada_varobj_ind (*value, *type, value, type);
+
+ /* If this is a tagged type, we need to transform it a bit in order
+ to be able to fetch its full view. As always with tagged types,
+ we can only do that if we have a value. */
+ if (*value != NULL && ada_is_tagged_type (*type, 1))
+ {
+ *value = ada_tag_value_at_base_address (*value);
+ *type = value_type (*value);
+ }
}
/* Assuming that the (PARENT_VALUE, PARENT_TYPE) pair is an array
/* Return the number of children for the (PARENT_VALUE, PARENT_TYPE)
pair. */
-int
+static int
ada_varobj_get_number_of_children (struct value *parent_value,
struct type *parent_type)
{
The result should be deallocated after use with xfree. */
-char *
+static char *
ada_varobj_get_name_of_child (struct value *parent_value,
struct type *parent_type,
const char *parent_name, int child_index)
The result must be deallocated after use with xfree. */
-char *
+static char *
ada_varobj_get_path_expr_of_child (struct value *parent_value,
struct type *parent_type,
const char *parent_name,
/* Return the value of child number CHILD_INDEX of the (PARENT_VALUE,
PARENT_TYPE) pair. PARENT_NAME is the name of the parent. */
-struct value *
+static struct value *
ada_varobj_get_value_of_child (struct value *parent_value,
struct type *parent_type,
const char *parent_name, int child_index)
/* Return the type of child number CHILD_INDEX of the (PARENT_VALUE,
PARENT_TYPE) pair. */
-struct type *
+static struct type *
ada_varobj_get_type_of_child (struct value *parent_value,
struct type *parent_type,
int child_index)
/* Return a string representation of the (VALUE, TYPE) pair, using
the given print options OPTS as our formatting options. */
-char *
+static char *
ada_varobj_get_value_of_variable (struct value *value,
struct type *type,
struct value_print_options *opts)