From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12077 invoked by alias); 4 Dec 2012 11:27:35 -0000 Received: (qmail 12066 invoked by uid 22791); 4 Dec 2012 11:27:34 -0000 X-SWARE-Spam-Status: No, hits=-3.5 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_SPAMHAUS_DROP,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from e06smtp17.uk.ibm.com (HELO e06smtp17.uk.ibm.com) (195.75.94.113) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 04 Dec 2012 11:27:25 +0000 Received: from /spool/local by e06smtp17.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 4 Dec 2012 11:27:19 -0000 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp17.uk.ibm.com (192.168.101.147) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 4 Dec 2012 11:27:17 -0000 Received: from d06av08.portsmouth.uk.ibm.com (d06av08.portsmouth.uk.ibm.com [9.149.37.249]) by b06cxnps3075.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id qB4BRDg64653332 for ; Tue, 4 Dec 2012 11:27:13 GMT Received: from d06av08.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av08.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id qB4BRLad023652 for ; Tue, 4 Dec 2012 04:27:21 -0700 Received: from BR87Z6LW (dyn-9-152-212-149.boeblingen.de.ibm.com [9.152.212.149]) by d06av08.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id qB4BRKb6023624; Tue, 4 Dec 2012 04:27:21 -0700 From: Andreas Arnez To: Joel Brobecker Subject: Unexpected DW_AT_type for Ada strings on s390x? CC: gdb@sourceware.org Date: Tue, 04 Dec 2012 11:27:00 -0000 Message-ID: <87fw3mhxbb.fsf@linux.vnet.ibm.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii x-cbid: 12120411-0542-0000-0000-000003C33F10 X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2012-12/txt/msg00010.txt.bz2 Upstream gnat seems to create different debug data for string parameters on s390x than on x86, x86_64 or s390. On s390x the DW_AT_type of a string parameter is a constant /reference/ to the two-element structure "string___XUP". On the other platforms it is the constant structure, not a reference. Due to this indirection the second "bt" in "lang_switch.exp" generates unexpected output; gdb now shows the "msg" parameter with an address like this: msg=@0x3ffffffdc48: {...} The test case fails on s390x because of that. Is the DW_AT_type output intentional? Why does it depend on the architecture? Note that for C or C++, gcc correctly declares structure parameters as /structures/ (not references) in their DW_AT_type. If the output is intentional, I suggest to relax the pattern in the test case accordingly. In any case it would be nice to differentiate the two "backtrace" test points, e.g. like this: --- a/gdb/testsuite/gdb.ada/lang_switch.exp +++ b/gdb/testsuite/gdb.ada/lang_switch.exp @@ -43,5 +43,5 @@ gdb_test "bt" \ gdb_test "set lang c" gdb_test "bt" \ ".*#1.*lang_switch\\.ada_procedure\\s*\\(msg={.*\\).*" \ - "backtrace" + "backtrace (C)"