+2012-02-29 Joel Brobecker <brobecker@adacore.com>
+
+ * ada-lang.c (to_fixed_array_type): Set result's type name.
+
2012-02-29 Joel Brobecker <brobecker@adacore.com>
* ada-lang.c (catch_ada_exception_command_split): Add new
error (_("array type with dynamic size is larger than varsize-limit"));
}
+ /* We want to preserve the type name. This can be useful when
+ trying to get the type name of a value that has already been
+ printed (for instance, if the user did "print VAR; whatis $". */
+ TYPE_NAME (result) = TYPE_NAME (type0);
+
if (constrained_packed_array_p)
{
/* So far, the resulting type has been created as if the original
+2012-02-29 Joel Brobecker <brobecker@adacore.com>
+
+ * gdb.ada/whatis_array_val: New testcase.
+
2012-02-29 Jan Kratochvil <jan.kratochvil@redhat.com>
Fix disp-step-syscall.exp: fork: single step over fork.
--- /dev/null
+# Copyright 2012 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"
+
+set testdir "whatis_array_val"
+set testfile "${testdir}/foo"
+set srcfile ${srcdir}/${subdir}/${testfile}.adb
+set binfile ${objdir}/${subdir}/${testfile}
+
+file mkdir ${objdir}/${subdir}/${testdir}
+if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } {
+ return -1
+}
+
+clean_restart ${testfile}
+
+set bp_location [gdb_get_line_number "STOP" ${testdir}/foo.adb]
+if ![runto "foo.adb:$bp_location" ] then {
+ perror "Couldn't run ${testfile}"
+ return
+}
+
+gdb_test "whatis full" \
+ "type = foo\\.full_table"
+
+gdb_test "print full" \
+ " = \\(144, 233, 377, 610, 987\\)"
+
+gdb_test "whatis $" \
+ "type = foo\\.full_table"
+
--- /dev/null
+-- Copyright 2012 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 Pck; use Pck;
+
+procedure Foo is
+ type Color is (Black, Red, Green, Blue, White);
+ type Full_Table is array (Color) of Integer;
+ Full : Full_Table := (144, 233, 377, 610, 987);
+begin
+ Do_Nothing (Full'Address); -- STOP
+end Foo;
+
--- /dev/null
+-- Copyright 2011-2012 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 Pck is
+
+ procedure Do_Nothing (A : System.Address) is
+ begin
+ null;
+ end Do_Nothing;
+
+end Pck;
--- /dev/null
+-- Copyright 2011-2012 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 Pck is
+ procedure Do_Nothing (A : System.Address);
+end Pck;