public inbox for gdb-testers@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] [Ada] Fix the evaluation of access to packed array subscript
@ 2015-09-14 15:05 sergiodj+buildbot
  2015-09-14 15:15 ` Failures on RHEL-s390x-m64, branch master sergiodj+buildbot
                   ` (15 more replies)
  0 siblings, 16 replies; 17+ messages in thread
From: sergiodj+buildbot @ 2015-09-14 15:05 UTC (permalink / raw)
  To: gdb-testers

*** TEST RESULTS FOR COMMIT 919e6dbe9b61a27e8f7f89121ba182907df461a3 ***

Author: Pierre-Marie de Rodat <derodat@adacore.com>
Branch: master
Commit: 919e6dbe9b61a27e8f7f89121ba182907df461a3

[Ada] Fix the evaluation of access to packed array subscript

This change is relevant only for standard DWARF (as opposed to the GNAT
encodings extensions): at the time of writing it only makes a difference
with GCC patches that are to be integrated: see in particular
<https://gcc.gnu.org/ml/gcc-patches/2015-07/msg01364.html>.

Given the following Ada declarations:

    type Small is mod 2 ** 6;
    type Array_Type is array (0 .. 9) of Small
       with Pack;
    type Array_Access is access all Array_Type;

    A  : aliased Array_Type := (1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
    AA : constant Array_Type := A'Access;

Before this change, we would get the following GDB session:

    (gdb) print aa.all(2)
    $1 = 3
    (gdb) print aa(2)
    $2 = 16

This is wrong: both expression should yield the same value: 3.  The
problem is simply that the routine which handles accesses to arrays lack
general handling for packed arrays.  After this patch, we have the
expected output:

    (gdb) print aa.all(2)
    $1 = 3
    (gdb) print aa(2)
    $2 = 3

gdb/ChangeLog:

	* ada-lang.c (ada_value_ptr_subscript): Update the heading
	comment.  Handle packed arrays.

gdb/testsuite/ChangeLog:

	* gdb.ada/access_to_packed_array.exp: New testcase.
	* gdb.ada/access_to_packed_array/foo.adb: New file.
	* gdb.ada/access_to_packed_array/pack.adb: New file.
	* gdb.ada/access_to_packed_array/pack.ads: New file.

Tested on x86_64-linux, no regression.


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2015-09-14 19:29 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-14 15:05 [binutils-gdb] [Ada] Fix the evaluation of access to packed array subscript sergiodj+buildbot
2015-09-14 15:15 ` Failures on RHEL-s390x-m64, branch master sergiodj+buildbot
2015-09-14 15:19 ` Failures on Debian-s390x-native-gdbserver-m64, " sergiodj+buildbot
2015-09-14 15:25 ` Failures on Debian-s390x-m64, " sergiodj+buildbot
2015-09-14 15:56 ` Failures on Fedora-x86_64-native-extended-gdbserver-m32, " sergiodj+buildbot
2015-09-14 15:57 ` Failures on Fedora-x86_64-cc-with-index, " sergiodj+buildbot
2015-09-14 16:26 ` Failures on Fedora-x86_64-native-extended-gdbserver-m64, " sergiodj+buildbot
2015-09-14 16:30 ` Failures on Fedora-x86_64-native-gdbserver-m64, " sergiodj+buildbot
2015-09-14 17:08 ` Failures on Fedora-x86_64-native-gdbserver-m32, " sergiodj+buildbot
2015-09-14 17:31 ` Failures on Fedora-s390x-m64, " sergiodj+buildbot
2015-09-14 17:55 ` Failures on Debian-i686, " sergiodj+buildbot
2015-09-14 18:42 ` Failures on Debian-i686-native-gdbserver, " sergiodj+buildbot
2015-09-14 18:49 ` Failures on Fedora-ppc64be-native-extended-gdbserver-m64, " sergiodj+buildbot
2015-09-14 19:19 ` Failures on Fedora-ppc64le-native-extended-gdbserver-m64, " sergiodj+buildbot
2015-09-14 23:44 ` Failures on Debian-i686-native-extended-gdbserver, " sergiodj+buildbot
2015-09-14 23:44 ` Failures on Fedora-ppc64le-m64, " sergiodj+buildbot
2015-09-15  9:38 ` Failures on Debian-x86_64-native-gdbserver-m64, " sergiodj+buildbot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).