+2015-05-15 Joel Brobecker <brobecker@adacore.com>
+
+ * ada-lang.c (ada_value_primitive_packed_val): Make sure
+ accumSize is never negative.
+
2015-05-14 Patrick Palka <patrick@parcs.ath.cx>
* tui/tui-command.c: Remove include of <ctype.h>.
accum |= sign << accumSize;
unpacked[targ] = accum & ~(~0L << HOST_CHAR_BIT);
accumSize -= HOST_CHAR_BIT;
+ if (accumSize < 0)
+ accumSize = 0;
accum >>= HOST_CHAR_BIT;
ntarg -= 1;
targ += delta;
+2015-05-15 Joel Brobecker <brobecker@adacore.com>
+
+ * gdb.ada/pckd_neg: New testcase.
+
2015-05-13 Patrick Palka <patrick@parcs.ath.cx>
PR gdb/17820
--- /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"
+
+if { [skip_ada_tests] } { return -1 }
+
+standard_ada_testfile foo_o508_021
+
+if {[gdb_compile_ada "${srcfile}" "${binfile}" executable {debug}] != ""} {
+ return -1
+}
+
+clean_restart ${testfile}
+
+set bp_location [gdb_get_line_number "STOP" ${testdir}/foo_o508_021.adb]
+runto "foo_o508_021.adb:$bp_location"
+
+gdb_test "print SSA" \
+ "= \\(-1, 2, -3, 4\\)"
+
+gdb_test "print SSA(1)" \
+ "= -1"
+
+gdb_test "print SSA(2)" \
+ "= 2"
+
+gdb_test "print SSA(3)" \
+ "= -3"
+
+gdb_test "print SSA(4)" \
+ "= 4"
--- /dev/null
+-- Copyright (C) 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 Pck; use Pck;
+
+procedure Foo_O508_021 is
+ SSA : Signed_Simple_Array := (-1, 2, -3, 4);
+begin
+ Update_Signed_Small (SSA (3)); -- STOP
+end Foo_O508_021;
--- /dev/null
+-- Copyright (C) 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 Pck is
+ procedure Update_Signed_Small (S : in out Signed_Small) is
+ begin
+ null;
+ end Update_Signed_Small;
+end Pck;
--- /dev/null
+-- Copyright (C) 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 Pck is
+ type Signed_Small is new Integer range - (2 ** 5) .. (2 ** 5 - 1);
+ type Signed_Simple_Array is array (1 .. 4) of Signed_Small;
+ pragma Pack (Signed_Simple_Array);
+
+ procedure Update_Signed_Small (S : in out Signed_Small);
+end Pck;