From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 07644385E012 for ; Wed, 26 Oct 2022 14:49:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 07644385E012 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1666795788; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=9o21RZcvxTkei/HEsP/NzvbDJyFlHZgz+bW5gE2uX8Q=; b=Qy8oCqC8LbzopscaE6gH3IVKjBk6Qq1nbzAcUfZIaeQwA78lGlIqH2KK6OUu2uukicDrUI HNb4O8dchvWonexuq3EZhm3NeWHeAeoYrO/R8L4H54tHpId/dVeY6MOr2vFehZ2PhfJigl hPnT+mREoSWQzhuVcmTl0MpTCDmwJtk= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-338-og7_jAvqOMalR_9_XTSyfw-1; Wed, 26 Oct 2022 10:49:47 -0400 X-MC-Unique: og7_jAvqOMalR_9_XTSyfw-1 Received: by mail-wm1-f69.google.com with SMTP id x12-20020a05600c21cc00b003c8340cb973so551472wmj.7 for ; Wed, 26 Oct 2022 07:49:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=9o21RZcvxTkei/HEsP/NzvbDJyFlHZgz+bW5gE2uX8Q=; b=opsI4ks4in9rkj0SUHpdvjX8yCVCtiXPGnxxQsNnIrrDuYYxqPWoBZhRpmfrnCO+DV fwxXhBREVfXKJPiaHhWNoj3YGK3xkHsPg60LrtxPd28COABwKn2vrbq3ZzcCTMfWEC9y Q+gcNsnscp7fumMQkqMzFmEGN3nTj6gxNCJVXEh6iROHCoJ7vhBoRxYBnNtXpDTeqk+s txV+TuIcOk+Xn6YcGEPGuPhfSlrmRECBTq0yClhFw+JFmThcj89U3WCPvENlDxiBEXRI hd+n2jOgeYUb2j3rIb4MYAPCD5glLPJB/P7q8Ld/JZuCn35svRZPb2TM1zwRCKVwqTNg sX+A== X-Gm-Message-State: ACrzQf11/mUo8G5+muwx9jO6GCcE5CQUfqP+IFj1vtPGBx3Rw3b79RgR 1vQhMAGOuJtxN5ORVhC9nhgPXvcApAWATkVlpTvlm1y32TG6qRd6R8YJUXKpGIafaeuTzOO0yrf F5yLPSzHrYTx/EDwHLOpldw== X-Received: by 2002:a05:6000:547:b0:218:5f6a:f5db with SMTP id b7-20020a056000054700b002185f6af5dbmr29535632wrf.480.1666795786519; Wed, 26 Oct 2022 07:49:46 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7SLIEKJyNUnspVhenZkid9pcOR8PK+Fh37xXnjjNdnAwLjNuZckIF6bIIP/tw8ZQiP6hshcQ== X-Received: by 2002:a05:6000:547:b0:218:5f6a:f5db with SMTP id b7-20020a056000054700b002185f6af5dbmr29535617wrf.480.1666795786269; Wed, 26 Oct 2022 07:49:46 -0700 (PDT) Received: from localhost ([31.111.84.238]) by smtp.gmail.com with ESMTPSA id i17-20020a05600c355100b003a8434530bbsm2231506wmq.13.2022.10.26.07.49.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Oct 2022 07:49:45 -0700 (PDT) From: Andrew Burgess To: Bruno Larsen , gdb-patches@sourceware.org Subject: Re: [PATCH 07/11] gdb/testsuite: skip gdb.cp/anon-struct.exp when using clang In-Reply-To: <20221004170747.154307-9-blarsen@redhat.com> References: <20221004170747.154307-1-blarsen@redhat.com> <20221004170747.154307-9-blarsen@redhat.com> Date: Wed, 26 Oct 2022 15:49:44 +0100 Message-ID: <87zgdi63nb.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_SHORT,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Bruno Larsen via Gdb-patches writes: > When clang compiles anonymous structures, it does not add linkage names in > their dwarf representations. This is compounded by clang not adding linkage > names to subprograms of those anonymous structs (for instance, the > constructor). > > Since this isn't a bug on clang or GDB, but there is no way to make > anon-struct.exp work when using clang, just mark that test as untested. > > Since I was already touching the file, I also added a comment at the top > of the file explaining what it is testing for. > --- > gdb/testsuite/gdb.cp/anon-struct.exp | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/gdb/testsuite/gdb.cp/anon-struct.exp b/gdb/testsuite/gdb.cp/anon-struct.exp > index 2c709ab9ecc..774ec882a07 100644 > --- a/gdb/testsuite/gdb.cp/anon-struct.exp > +++ b/gdb/testsuite/gdb.cp/anon-struct.exp > @@ -14,12 +14,20 @@ > # You should have received a copy of the GNU General Public License > # along with this program. If not, see . > > +# This test is used to verify GDB's abiility to refer to linkage names > +# for types and functions. Type: 'ability'. Also, I wonder if this comment should explicitly say something like: "...for types and functions within anonymous structs." maybe? > + > standard_testfile .cc > > if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug c++}] } { > return -1 > } > > +if {[test_compiler_info clang-*-*]} { Missing the language argument to test_compiler_info. > + untested "clang does not use linkage name in this case" > + return You specifically call out the missing linkage name here, but both the DW_AT_name and DW_AT_linkage name are filled in by GCC, and not with Clang. Is it the linkage name in particular that is critical here? Either way, I wonder if a more extended comment within this if block might be useful, just touching on the differences in behaviour between GCC and Clang, and why than means this test will not work with Clang. Thanks, Andrew > +} > + > if { [is_aarch32_target] } { > gdb_test "ptype t::t" "type = struct t {\r\n C m;\r\n} \\*\\(t \\* const\\)" \ > "print type of t::t" > -- > 2.37.3