This is the mail archive of the
gdb-testers@sourceware.org
mailing list for the GDB project.
[binutils-gdb] [Ada] Fix handling of array renamings
- From: sergiodj+buildbot at redhat dot com
- To: gdb-testers at sourceware dot org
- Date: Wed, 23 Sep 2015 16:23:06 -0400
- Subject: [binutils-gdb] [Ada] Fix handling of array renamings
- Authentication-results: sourceware.org; auth=none
*** TEST RESULTS FOR COMMIT e6c2c623f7736175e52fce2b61aab60c60eccdf5 ***
Author: Pierre-Marie de Rodat <derodat@adacore.com>
Branch: master
Commit: e6c2c623f7736175e52fce2b61aab60c60eccdf5
[Ada] Fix handling of array renamings
Compilers can materialize renamings of arrays (or of accesses to arrays)
in Ada into variables whose types are references to the actual array
types. Before this change, trying to use such an array renaming yielded
an error in GDB:
(gdb) print my_array(1)
cannot subscript or call a record
(gdb) print my_array_ptr(1)
cannot subscript or call something of type `(null)'
This behavior comes from bad handling for array renamings, in particular
the OP_FUNCALL expression operator handling from ada-lang.c
(ada_evaluate_subexp): in one place we turn the reference into a
pointer, but the code that follows expect the value to be an array.
This patch fixes how we handle references in call/subscript evaluation
so that we turn these references into the actual array values instead of
pointers to them.
gdb/ChangeLog:
* ada-lang.c (ada_evaluate_subexp) <OP_FUNCALL>: When the input
value is a reference, actually dereference it in order to get
the underlying value.
gdb/testsuite/ChangeLog:
* gdb.ada/array_ptr_renaming.exp: New testcase.
* gdb.ada/array_ptr_renaming/foo.adb: New file.
* gdb.ada/array_ptr_renaming/pack.ads: New file.
Tested on x86_64-linux, no regression.
- Follow-Ups:
- Failures on Debian-s390x-native-gdbserver-m64, branch master
- Failures on RHEL-s390x-m64, branch master
- Failures on Fedora-x86_64-native-extended-gdbserver-m32, branch master
- Failures on Debian-s390x-native-extended-gdbserver-m64, branch master
- Failures on AIX-POWER7-plain, branch master
- Failures on Fedora-s390x-m64, branch master
- Failures on Debian-i686, branch master
- Failures on Fedora-x86_64-native-extended-gdbserver-m64, branch master
- Failures on Fedora-x86_64-native-gdbserver-m64, branch master
- Failures on Fedora-ppc64le-native-extended-gdbserver-m64, branch master
- Failures on Fedora-x86_64-native-gdbserver-m32, branch master
- Failures on Fedora-ppc64be-native-gdbserver-m64, branch master
- Failures on Debian-i686-native-gdbserver, branch master
- Failures on Fedora-ppc64le-cc-with-index, branch master
- Failures on Fedora-ppc64be-native-extended-gdbserver-m64, branch master
- Failures on Debian-i686-native-extended-gdbserver, branch master
- Failures on Debian-x86_64-native-gdbserver-m64, branch master