+2018-09-10 Xavier Roirand <roirand@adacore.com>
+
+ * ada-valprint.c (ada_value_print): Use type instead of
+ enclosing type.
+
2018-09-10 Xavier Roirand <roirand@adacore.com>
* ada-lang.c (ada_value_subscript): Handle case when parameter is
{
struct value *val = ada_to_fixed_value (val0);
CORE_ADDR address = value_address (val);
- struct type *type = ada_check_typedef (value_enclosing_type (val));
+ struct type *type = ada_check_typedef (value_type (val));
struct value_print_options opts;
/* If it is a pointer, indicate what it points to. */
+2018-09-10 Xavier Roirand <roirand@adacore.com>
+
+ * gdb.ada/access_to_unbounded_array.exp: New testcase.
+ * gdb.ada/access_to_unbounded_array/foo.adb: New file.
+ * gdb.ada/access_to_unbounded_array/pack.adb: New file.
+ * gdb.ada/access_to_unbounded_array/pack.ads: New file.
+
2018-09-10 Xavier Roirand <roirand@adacore.com>
* gdb.ada/mi_string_access.exp: New testcase.
--- /dev/null
+# Copyright 2018 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+load_lib "ada.exp"
+
+standard_ada_testfile foo
+
+if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug]] != "" } {
+ return -1
+}
+
+clean_restart ${testfile}
+
+set bp_location [gdb_get_line_number "BREAK" ${testdir}/foo.adb]
+runto "foo.adb:$bp_location"
+
+gdb_test "print Aos(1)" " = \\(foo.string_access\\) $hex"
+gdb_test "print Aos(2)" " = \\(foo.string_access\\) $hex"
--- /dev/null
+-- Copyright 2018 Free Software Foundation, Inc.
+--
+-- This program is free software; you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation; either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+with Pack; use Pack;
+
+procedure Foo is
+ type String_Access is access String;
+ type Array_Of_String is array (1 .. 2) of String_Access;
+ Aos : Array_Of_String := (new String'("ab"), new String'("cd"));
+begin
+ Do_Nothing (Aos'Address); -- BREAK
+end Foo;
--- /dev/null
+-- Copyright 2018 Free Software Foundation, Inc.
+--
+-- This program is free software; you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation; either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+package body Pack is
+
+ procedure Do_Nothing (A : System.Address) is
+ begin
+ null;
+ end Do_Nothing;
+
+end Pack;
--- /dev/null
+-- Copyright 2018 Free Software Foundation, Inc.
+--
+-- This program is free software; you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation; either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+with System;
+package Pack is
+ procedure Do_Nothing (A : System.Address);
+end Pack;