+2015-07-23 Pierre-Marie de Rodat <derodat@adacore.com>
+
+ * gdbtypes.c (resolve_dynamic_array): Pass the peeled element
+ type to the recursive call instead of the original (maybe
+ TYPE_CODE_TYPEDEF) type.
+
2015-07-23 Yao Qi <yao.qi@linaro.org>
* aarch64-linux-nat.c (aarch64_linux_can_use_hw_breakpoint): If
ary_dim = check_typedef (TYPE_TARGET_TYPE (elt_type));
if (ary_dim != NULL && TYPE_CODE (ary_dim) == TYPE_CODE_ARRAY)
- elt_type = resolve_dynamic_array (TYPE_TARGET_TYPE (type), addr_stack);
+ elt_type = resolve_dynamic_array (ary_dim, addr_stack);
else
elt_type = TYPE_TARGET_TYPE (type);
+2015-07-23 Pierre-Marie de Rodat <derodat@adacore.com>
+
+ * gdb.ada/var_arr_typedef.exp: New testcase.
+ * gdb.ada/var_arr_typedef/pack.adb: New file.
+ * gdb.ada/var_arr_typedef/pack.ads: New file.
+ * gdb.ada/var_arr_typedef/var_arr_typedef.adb: New file.
+
2015-07-20 Joel Brobecker <brobecker@adacore.com>
* gdb.ada/info_exc.exp: Adjust "info exceptions" expected output.
--- /dev/null
+# Copyright 2015 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 var_arr_typedef
+
+if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug]] != "" } {
+ return -1
+}
+
+clean_restart ${testfile}
+
+set bp_location [gdb_get_line_number "BREAK" ${testdir}/var_arr_typedef.adb]
+runto "var_arr_typedef.adb:$bp_location"
+
+set ra "\\(i => 3, b => false\\)"
+set rb "\\(i => 2, b => true\\)"
+
+set va "\\($ra, $ra, $rb, $rb\\)"
+set vb "\\($rb, $rb, $ra, $ra\\)"
+
+set a "\\($va, $va, $vb, $vb\\)"
+
+gdb_test "print va" \
+ " = $va"
+
+gdb_test "print vb" \
+ " = $vb"
+
+gdb_test "print a" \
+ " = $a"
--- /dev/null
+-- Copyright 2015 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
+
+ function Identity (I : Integer) return Integer is
+ begin
+ return I;
+ end Identity;
+
+ procedure Do_Nothing (A : Array_Type) is null;
+
+end Pack;
--- /dev/null
+-- Copyright 2015 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 Pack is
+ type Rec_Type is record
+ I : Integer;
+ B : Boolean;
+ end record;
+
+ type Vec_Type is array (1 .. 4) of Rec_Type;
+
+ type Array_Type is array (Positive range <>) of Vec_Type;
+
+ procedure Do_Nothing (A : Array_Type);
+ function Identity (I : Integer) return Integer;
+
+end Pack;
--- /dev/null
+-- Copyright 2015 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 Var_Arr_Typedef is
+ RA : constant Rec_Type := (3, False);
+ RB : constant Rec_Type := (2, True);
+
+ VA : constant Vec_Type := (RA, RA, RB, RB);
+ VB : constant Vec_Type := (RB, RB, RA, RA);
+
+ A : constant Array_Type (1 .. Identity (4)) := (VA, VA, VB, VB);
+begin
+ Do_Nothing (A); -- BREAK
+end Var_Arr_Typedef;