From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12188 invoked by alias); 4 Dec 2012 12:11:10 -0000 Received: (qmail 12116 invoked by uid 22791); 4 Dec 2012 12:10:55 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_HOSTKARMA_NO X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 04 Dec 2012 12:10:47 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 6DA5E1C6211; Tue, 4 Dec 2012 07:10:46 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id Arzq32Hd4BCU; Tue, 4 Dec 2012 07:10:46 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id F27071C60E5; Tue, 4 Dec 2012 07:10:45 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id 80AABC373F; Tue, 4 Dec 2012 16:10:36 +0400 (RET) Date: Tue, 04 Dec 2012 12:11:00 -0000 From: Joel Brobecker To: Andreas Arnez Cc: gdb@sourceware.org, Eric Botcazou Subject: Re: Unexpected DW_AT_type for Ada strings on s390x? Message-ID: <20121204121036.GK18566@adacore.com> References: <87fw3mhxbb.fsf@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="5I6of5zJg18YgZEa" Content-Disposition: inline In-Reply-To: <87fw3mhxbb.fsf@linux.vnet.ibm.com> User-Agent: Mutt/1.5.21 (2010-09-15) 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/msg00011.txt.bz2 --5I6of5zJg18YgZEa Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 1474 [Cc'ing Eric, as he is the compiler expert - GDB just represents what the compiler tells us] > 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. My first guess is that the variantion in type definition is caused by differences in ABI. I don't know s390 platforms, so I can't confirm offhand. But it seems like a plausible way to pass the argument. If Eric confirms my guess, the attached patch should fix the problem. [the rest of your email is kept below - as a reference for Eric, in case he needs it] > 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)" -- Joel --5I6of5zJg18YgZEa Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0001-gdb.ada-lang_switch-Allow-msg-parameter-to-be-a-refe.patch" Content-length: 988 >From cdb4ea7d663ca7eab453f31a45f6fae068753803 Mon Sep 17 00:00:00 2001 From: Joel Brobecker Date: Tue, 4 Dec 2012 16:04:26 +0400 Subject: [PATCH] gdb.ada/lang_switch: Allow msg parameter to be a reference. gdb/testsuite/ChangeLog: * gdb.ada/lang_switch.exp: The "msg" parameter may be a reference. --- gdb/testsuite/gdb.ada/lang_switch.exp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/gdb/testsuite/gdb.ada/lang_switch.exp b/gdb/testsuite/gdb.ada/lang_switch.exp index 6ee4c23..a217d2e 100644 --- a/gdb/testsuite/gdb.ada/lang_switch.exp +++ b/gdb/testsuite/gdb.ada/lang_switch.exp @@ -42,6 +42,5 @@ gdb_test "bt" \ # if the current language is not "auto". gdb_test "set lang c" gdb_test "bt" \ - ".*#1.*lang_switch\\.ada_procedure\\s*\\(msg={.*\\).*" \ - "backtrace" - + ".*#1.*lang_switch\\.ada_procedure\\s*\\(msg=(@$hex: +)?{.*\\).*" \ + "backtrace with lang set to C" -- 1.7.10.4 --5I6of5zJg18YgZEa--