From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id KAk5LvBuw2AWbAAAWB0awg (envelope-from ) for ; Fri, 11 Jun 2021 10:10:56 -0400 Received: by simark.ca (Postfix, from userid 112) id ABC561F163; Fri, 11 Jun 2021 10:10:56 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id EDC001E813 for ; Fri, 11 Jun 2021 10:10:54 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 550E0389365C for ; Fri, 11 Jun 2021 14:10:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 550E0389365C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1623420654; bh=AlsS7OIyTVuVeUACJuFDpExnphtWuXGlpm+Zatf5MZw=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=ycLoXyDOrNMx3KP5JE1zms8CucUZu3vhOlKuW5cNOwg5lU7/4iI4z7BeFMzze1cb7 fgWODqGiYv+am3kl+JujBCOBuACU3cLqbuv3EcV1mpHzQ/SA3ZZ6V+vu7L2BmAABmJ sne6KenjSBbnuz3Yts9RISHNghzJ24kyOaAm0N98= Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 912A33886C53 for ; Fri, 11 Jun 2021 14:10:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 912A33886C53 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 15BEANeW007285 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 11 Jun 2021 10:10:28 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 15BEANeW007285 Received: from [10.0.0.11] (192-222-157-6.qc.cable.ebox.net [192.222.157.6]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 36A991E813; Fri, 11 Jun 2021 10:10:23 -0400 (EDT) Subject: Re: [PING**3] [PATCH] gdb, testsuite: Fix mi-var-child-f.exp for Intel compilers. To: "Willgerodt, Felix" , "gdb-patches@sourceware.org" References: Message-ID: <10d61e20-856a-76f6-ea43-1293496286ba@polymtl.ca> Date: Fri, 11 Jun 2021 10:10:22 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Fri, 11 Jun 2021 14:10:23 +0000 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Simon Marchi via Gdb-patches Reply-To: Simon Marchi Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" Andrew, do you have an opinion on this? Simon On 2021-06-11 8:51 a.m., Willgerodt, Felix via Gdb-patches wrote: > *Ping* > > Regards, > Felix > > -----Original Message----- > From: Willgerodt, Felix > Sent: Mittwoch, 2. Juni 2021 09:24 > To: gdb-patches@sourceware.org > Subject: RE: [PING**2] [PATCH] gdb, testsuite: Fix mi-var-child-f.exp for Intel compilers. > > *Ping* > > Keith Seitz is in favour of this but can't approve. > > Regards, > Felix > > -----Original Message----- > From: Willgerodt, Felix > Sent: Freitag, 21. Mai 2021 08:52 > To: gdb-patches@sourceware.org > Subject: [Ping] [PATCH] gdb, testsuite: Fix mi-var-child-f.exp for Intel compilers. > > Kindly pinging! > > Felix > > -----Original Message----- > From: Willgerodt, Felix > Sent: Freitag, 7. Mai 2021 09:33 > To: Willgerodt, Felix ; gdb-patches@sourceware.org > Subject: [PATCH] gdb, testsuite: Fix mi-var-child-f.exp for Intel compilers. > > mi-var-child-f.exp uses array.f as the inferior, which uses an unnamed main function. This causes false positive fails for Intel compilers, as they emit the following DWARF: > > ~~~ > 0x0000002a: DW_TAG_subprogram > DW_AT_low_pc (0x0000000000404800) > DW_AT_high_pc (0x000000000040484c) > DW_AT_frame_base (DW_OP_reg6 RBP) > DW_AT_linkage_name ("MAIN__") > DW_AT_name ("_unnamed_main$$") > DW_AT_decl_file ("array.f") > DW_AT_decl_line (16) > DW_AT_external (true) > DW_AT_main_subprogram (true) > ~~~ > > The testsuite for fortran uses test_compiler_info to determine a hardcoded string which is used to run to main and as a testing regex: > > ~~~ > proc fortran_main {} { > if {[test_compiler_info {gcc-4-[012]-*}] > || [test_compiler_info {gcc-*}] > || [test_compiler_info {icc-*}] { > return "MAIN__" > } elseif {[test_compiler_info {clang-*}]} { > return "MAIN_" > } else { > return "unknown" > } > } > ~~~ > > GDB however uses DW_AT_name mostly in its output, which fails the regex. > To fix this testcase immediately, I modernized array.f and gave it a named main. There was no specific reason it was unnamed anyway. Fixing the testsuite properly is not straightforward. fortran_main and test_compiler_info would need some changes, which has broader influences. > I might look at this later down the road. > > gdb/testsuite/ChangeLog: > 2021-05-06 Felix Willgerodt > > * gdb.mi/array.f: Convert into... > * gdb.mi/array.f90: ...this. > * gdb.mi/mi-var-child-f.exp: Use array.f90. > --- > gdb/testsuite/gdb.mi/array.f | 20 -------------------- > gdb/testsuite/gdb.mi/array.f90 | 21 +++++++++++++++++++++ > gdb/testsuite/gdb.mi/mi-var-child-f.exp | 4 ++-- > 3 files changed, 23 insertions(+), 22 deletions(-) delete mode 100644 gdb/testsuite/gdb.mi/array.f create mode 100644 gdb/testsuite/gdb.mi/array.f90 > > diff --git a/gdb/testsuite/gdb.mi/array.f b/gdb/testsuite/gdb.mi/array.f deleted file mode 100644 index 2d31ecae984..00000000000 > --- a/gdb/testsuite/gdb.mi/array.f > +++ /dev/null > @@ -1,20 +0,0 @@ > -c Copyright 2006-2021 Free Software Foundation, Inc. > - > -c This program is free software; you can redistribute it and/or modify -c it under the terms of the GNU General Public License as published by -c the Free Software Foundation; either version 3 of the License, or -c (at your option) any later version. > -c > -c This program is distributed in the hope that it will be useful, -c but WITHOUT ANY WARRANTY; without even the implied warranty of -c MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -c GNU General Public License for more details. > -c > -c You should have received a copy of the GNU General Public License -c along with this program. If not, see . > - > - INTEGER array(1:2,-1:1) > - DATA array/11,21,12,22,13,23/ > - CONTINUE > - STOP > - END > diff --git a/gdb/testsuite/gdb.mi/array.f90 b/gdb/testsuite/gdb.mi/array.f90 new file mode 100644 index 00000000000..b414b27e026 > --- /dev/null > +++ b/gdb/testsuite/gdb.mi/array.f90 > @@ -0,0 +1,21 @@ > +! Copyright 2006-2021 Free Software Foundation, Inc. > + > +! This program is free software; you can redistribute it and/or modify > +! it under the terms of the GNU General Public License as published by > +! the Free Software Foundation; either version 3 of the License, or ! > +(at your option) any later version. > +! > +! This program is distributed in the hope that it will be useful, ! but > +WITHOUT ANY WARRANTY; without even the implied warranty of ! > +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU > +General Public License for more details. > +! > +! You should have received a copy of the GNU General Public License ! > +along with this program. If not, see . > + > +program prog_array > + INTEGER array (1:2,-1:1) > + DATA array/11,21,12,22,13,23/ > + CONTINUE > + STOP > +end program prog_array > diff --git a/gdb/testsuite/gdb.mi/mi-var-child-f.exp b/gdb/testsuite/gdb.mi/mi-var-child-f.exp > index 272505a4d69..f35c0cdd6d3 100644 > --- a/gdb/testsuite/gdb.mi/mi-var-child-f.exp > +++ b/gdb/testsuite/gdb.mi/mi-var-child-f.exp > @@ -26,7 +26,7 @@ if [mi_gdb_start] { > continue > } > > -standard_testfile array.f > +standard_testfile array.f90 > > if {[gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \ > executable {debug f90}] != ""} { > @@ -36,7 +36,7 @@ if {[gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \ mi_gdb_reinitialize_dir $srcdir/$subdir mi_gdb_load ${binfile} > > -mi_runto [fortran_main] > +mi_runto prog_array > > mi_create_varobj "array" "array" "create local variable array" > > -- > 2.25.4 > > Intel Deutschland GmbH > Registered Address: Am Campeon 10, 85579 Neubiberg, Germany > Tel: +49 89 99 8853-0, www.intel.de > Managing Directors: Christin Eisenschmid, Sharon Heck, Tiffany Doon Silva > Chairperson of the Supervisory Board: Nicole Lau > Registered Office: Munich > Commercial Register: Amtsgericht Muenchen HRB 186928 >