This is the mail archive of the
gdb-testers@sourceware.org
mailing list for the GDB project.
[binutils-gdb] Ada: unable to compare strings (Attempt to compare array with non-array)
- From: sergiodj+buildbot at sergiodj dot net
- To: gdb-testers at sourceware dot org
- Date: Thu, 14 Dec 2017 00:57:24 -0500
- Subject: [binutils-gdb] Ada: unable to compare strings (Attempt to compare array with non-array)
- Authentication-results: sourceware.org; auth=none
*** TEST RESULTS FOR COMMIT 79e8fcaafa92e7b4a74e510c5487e87c60ff1945 ***
Author: Joel Brobecker <brobecker@adacore.com>
Branch: master
Commit: 79e8fcaafa92e7b4a74e510c5487e87c60ff1945
Ada: unable to compare strings (Attempt to compare array with non-array)
Consider the following Ada Code:
type Str is new String (1 .. 4);
My_str : Str := "ABCD";
This simply declares a 4-character string type. Trying to perform
equality tests using it currently yield an error:
(gdb) p my_str = my_str
Attempt to compare array with non-array
(gdb) p my_str = "ABCD"
Attempt to compare array with non-array
The error occurs because my_str is defined as an object whose
type is a typdef to a TYPE_CODE_ARRAY, which ada_value_equal
is not expecting at all (yet). This patch fixes this oversight.
gdb/ChangeLog:
* ada-lang.c (ada_value_equal): Add handling of typedef types
when comparing array objects.
gdb/testsuite/ChangeLog:
* gdb.ada/str_binop_equal: New testcase.
Tested on x86_64-linux.
- Follow-Ups:
- Failures on Ubuntu-AArch64-native-gdbserver-m64, branch master
- Failures on Ubuntu-AArch64-m64, branch master
- Failures on Ubuntu-AArch32-native-extended-gdbserver-m32, branch master
- Failures on Fedora-x86_64-m64, branch master
- Failures on Fedora-x86_64-native-gdbserver-m32, branch master
- Failures on Ubuntu-AArch32-m32, branch master
- Failures on Fedora-i686, branch master
- Failures on Fedora-x86_64-native-extended-gdbserver-m32, 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-x86_64-m32, branch master
- Failures on Fedora-x86_64-cc-with-index, branch master