diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index f6a623d79ed..c0cc512bfa3 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -2141,6 +2141,7 @@ ada_type_of_array (struct value *arr, int bounds) longest_to_int (value_as_long (low)), longest_to_int (value_as_long (high))); elt_type = create_array_type (alloc, elt_type, range_type); + INIT_GNAT_SPECIFIC (elt_type); if (ada_is_unconstrained_packed_array_type (arr->type ())) { diff --git a/gdb/python/py-value.c b/gdb/python/py-value.c index 069560742cf..e1178de89e9 100644 --- a/gdb/python/py-value.c +++ b/gdb/python/py-value.c @@ -28,6 +28,7 @@ #include "expression.h" #include "cp-abi.h" #include "python.h" +#include "ada-lang.h" #include "python-internal.h" @@ -1096,6 +1097,8 @@ valpy_getitem (PyObject *self, PyObject *key) if (type->code () != TYPE_CODE_ARRAY && type->code () != TYPE_CODE_PTR) error (_("Cannot subscript requested type.")); + else if (ADA_TYPE_P (type)) + res_val = ada_value_subscript (tmp, 1, &idx); else res_val = value_subscript (tmp, value_as_long (idx)); }