From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 51680 invoked by alias); 14 Dec 2017 05:57:28 -0000 Mailing-List: contact gdb-testers-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-testers-owner@sourceware.org Received: (qmail 51659 invoked by uid 89); 14 Dec 2017 05:57:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= X-HELO: kwanyin.sergiodj.net Received: from kwanyin.sergiodj.net (HELO kwanyin.sergiodj.net) (158.69.185.54) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 14 Dec 2017 05:57:26 +0000 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [binutils-gdb] Ada: unable to compare strings (Attempt to compare array with non-array) From: sergiodj+buildbot@sergiodj.net To: gdb-testers@sourceware.org Message-Id: <79e8fcaafa92e7b4a74e510c5487e87c60ff1945@gdb-build> Date: Thu, 14 Dec 2017 05:57:00 -0000 X-SW-Source: 2017-q4/txt/msg08132.txt.bz2 *** TEST RESULTS FOR COMMIT 79e8fcaafa92e7b4a74e510c5487e87c60ff1945 *** Author: Joel Brobecker 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.