diff options
Diffstat (limited to 'gdb/testsuite')
-rw-r--r-- | gdb/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gdb/testsuite/gdb.ada/byte_packed_arr.exp | 32 | ||||
-rw-r--r-- | gdb/testsuite/gdb.ada/byte_packed_arr/array_list_g.ads | 27 | ||||
-rw-r--r-- | gdb/testsuite/gdb.ada/byte_packed_arr/reprod.adb | 22 | ||||
-rw-r--r-- | gdb/testsuite/gdb.ada/byte_packed_arr/reprod.ads | 35 | ||||
-rw-r--r-- | gdb/testsuite/gdb.ada/byte_packed_arr/reprod_main.adb | 23 |
6 files changed, 143 insertions, 0 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index cc2c156..74559f4 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,5 +1,9 @@ 2015-05-15 Joel Brobecker <brobecker@adacore.com> + * gdb.ada/byte_packed_arr: New testcase. + +2015-05-15 Joel Brobecker <brobecker@adacore.com> + * gdb.ada/pckd_neg: New testcase. 2015-05-13 Patrick Palka <patrick@parcs.ath.cx> diff --git a/gdb/testsuite/gdb.ada/byte_packed_arr.exp b/gdb/testsuite/gdb.ada/byte_packed_arr.exp new file mode 100644 index 0000000..1a66f59 --- /dev/null +++ b/gdb/testsuite/gdb.ada/byte_packed_arr.exp @@ -0,0 +1,32 @@ +# 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 reprod_main + +if {[gdb_compile_ada "${srcfile}" "${binfile}" executable {debug}] != ""} { + return -1 +} + +clean_restart ${testfile} + +set bp_location [gdb_get_line_number "STOP" ${testdir}/reprod.adb] +runto "reprod.adb:$bp_location" + +gdb_test "print broken" \ + " = \\(len => 1, data => \\(\\(i => 1\\)\\)\\)" diff --git a/gdb/testsuite/gdb.ada/byte_packed_arr/array_list_g.ads b/gdb/testsuite/gdb.ada/byte_packed_arr/array_list_g.ads new file mode 100644 index 0000000..288d88f --- /dev/null +++ b/gdb/testsuite/gdb.ada/byte_packed_arr/array_list_g.ads @@ -0,0 +1,27 @@ +-- 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/>. + +generic + type Index_Base_T is range <>; + type Component_T is private; +package Array_List_G is + + subtype Length_T is Index_Base_T range 0 .. Index_Base_T'Last; + subtype Index_T is Length_T range 1 .. Length_T'Last; + + type T is array (Index_T range <>) of Component_T; + pragma Pack(T); + +end Array_List_G; diff --git a/gdb/testsuite/gdb.ada/byte_packed_arr/reprod.adb b/gdb/testsuite/gdb.ada/byte_packed_arr/reprod.adb new file mode 100644 index 0000000..6beacab --- /dev/null +++ b/gdb/testsuite/gdb.ada/byte_packed_arr/reprod.adb @@ -0,0 +1,22 @@ +-- 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 Reprod is + + procedure Do_Nothing (Broken : Obj_T) is + begin + null; -- STOP + end Do_Nothing; +end Reprod; diff --git a/gdb/testsuite/gdb.ada/byte_packed_arr/reprod.ads b/gdb/testsuite/gdb.ada/byte_packed_arr/reprod.ads new file mode 100644 index 0000000..9a2c325 --- /dev/null +++ b/gdb/testsuite/gdb.ada/byte_packed_arr/reprod.ads @@ -0,0 +1,35 @@ +-- 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 Array_List_G; + +package Reprod is + + package Objects is + type T is record + I : Integer; + end record; + package List is new Array_List_G (Index_Base_T => Natural, + Component_T => T); + end Objects; + + type Obj_T (Len : Natural) is record + Data : Objects.List.T (1 .. Len); + end record; + + type T is access Obj_T; + + procedure Do_Nothing (Broken : Obj_T); +end Reprod; diff --git a/gdb/testsuite/gdb.ada/byte_packed_arr/reprod_main.adb b/gdb/testsuite/gdb.ada/byte_packed_arr/reprod_main.adb new file mode 100644 index 0000000..09f804f --- /dev/null +++ b/gdb/testsuite/gdb.ada/byte_packed_arr/reprod_main.adb @@ -0,0 +1,23 @@ +-- 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 Reprod; use Reprod; + +procedure Reprod_Main is + O : Obj_T (Len => 1); +begin + O.Data := (others => (I => 1)); + Do_Nothing (O); +end Reprod_Main; |