From patchwork Mon Nov 7 13:45:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guinevere Larsen X-Patchwork-Id: 60087 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BE3D73857C60 for ; Mon, 7 Nov 2022 13:53:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BE3D73857C60 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1667829201; bh=0pmhQOVGNWZuWZItRxgnXnD4Rfu/dpHawDY3mNbr06M=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=FS+KTOAsTGeka8DnDYlEOkPvEIiuex12zapKMTAnqBT5MRM+3reVPxnaRDXz4zKsF sUmeNngSZOZxQ0kM509ezM/GXdn3Z88tb7z7FB5vBQajUwGl5zmYcfN0bZRmeKkQXd JTqGxlX0VdXUn5upBsQfHsxV5Co1Sx3kxfOq9w70= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org 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 20C003858415 for ; Mon, 7 Nov 2022 13:52:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 20C003858415 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-456-lF6XZB5pPUyMaBGj9wsaUg-1; Mon, 07 Nov 2022 08:52:54 -0500 X-MC-Unique: lF6XZB5pPUyMaBGj9wsaUg-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 479263817989 for ; Mon, 7 Nov 2022 13:52:54 +0000 (UTC) Received: from fedora.redhat.com (ovpn-193-251.brq.redhat.com [10.40.193.251]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 387022028E8F; Mon, 7 Nov 2022 13:52:53 +0000 (UTC) To: gdb-patches@sourceware.org Cc: Bruno Larsen Subject: [PATCH v2 1/9] gdb/testsuite: ignore Non-C-typedefs for gdb.cp/class2.exp Date: Mon, 7 Nov 2022 14:45:57 +0100 Message-Id: <20221107134604.596986-2-blarsen@redhat.com> In-Reply-To: <20221107134604.596986-1-blarsen@redhat.com> References: <20221107134604.596986-1-blarsen@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, 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 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: , X-Patchwork-Original-From: Bruno Larsen via Gdb-patches From: Guinevere Larsen Reply-To: Bruno Larsen Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" When attempting to test gdb.cp/class2.exp using Clang, it fails to prepare with the following error: Executing on host: clang++ -fdiagnostics-color=never -Wno-unknown-warning-option -c -g -o /home/blarsen/Documents/fsf_build/gdb/testsuite/outputs/gdb.cp/class2/class20.o /home/blarsen/Documents/fsf_build/gdb/testsuite/../../../binutils-gdb/gdb/testsuite/gdb.cp/class2.cc (timeout = 300) builtin_spawn -ignore SIGHUP clang++ -fdiagnostics-color=never -Wno-unknown-warning-option -c -g -o /home/blarsen/Documents/fsf_build/gdb/testsuite/outputs/gdb.cp/class2/class20.o /home/blarsen/Documents/fsf_build/gdb/testsuite/../../../binutils-gdb/gdb/testsuite/gdb.cp/class2.cc /home/blarsen/Documents/fsf_build/gdb/testsuite/../../../binutils-gdb/gdb/testsuite/gdb.cp/class2.cc:53:14: warning: anonymous non-C-compatible type given name for linkage purposes by typedef declaration; add a tag name here [-Wnon-c-typedef-for-linkage] typedef class { ^ Dbase /home/blarsen/Documents/fsf_build/gdb/testsuite/../../../binutils-gdb/gdb/testsuite/gdb.cp/class2.cc:54:2: note: type is not C-compatible due to this member declaration public: ^~~~~~~ /home/blarsen/Documents/fsf_build/gdb/testsuite/../../../binutils-gdb/gdb/testsuite/gdb.cp/class2.cc:58:3: note: type is given name 'Dbase' for linkage purposes by this typedef declaration } Dbase; ^ 1 warning generated. gdb compile failed, /home/blarsen/Documents/fsf_build/gdb/testsuite/../../../binutils-gdb/gdb/testsuite/gdb.cp/class2.cc:53:14: warning: anonymous non-C-compatible type given name for linkage purposes by typedef declaration; add a tag name here [-Wnon-c-typedef-for-linkage] typedef class { ^ Dbase /home/blarsen/Documents/fsf_build/gdb/testsuite/../../../binutils-gdb/gdb/testsuite/gdb.cp/class2.cc:54:2: note: type is not C-compatible due to this member declaration public: ^~~~~~~ /home/blarsen/Documents/fsf_build/gdb/testsuite/../../../binutils-gdb/gdb/testsuite/gdb.cp/class2.cc:58:3: note: type is given name 'Dbase' for linkage purposes by this typedef declaration } Dbase; ^ 1 warning generated. UNTESTED: gdb.cp/class2.exp: failed to prepare This can be silenced by adding -Wno-non-c-typedef-for-linkage for Clang 11 or later. The test shows no failures with this change. --- gdb/testsuite/gdb.cp/class2.exp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/gdb.cp/class2.exp b/gdb/testsuite/gdb.cp/class2.exp index 32f9dfc18a5..cc192b6de64 100644 --- a/gdb/testsuite/gdb.cp/class2.exp +++ b/gdb/testsuite/gdb.cp/class2.exp @@ -18,7 +18,14 @@ if { [skip_cplus_tests] } { return } standard_testfile .cc -if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} { +set flags [list debug c++] +# When using recent Clangs, this test fails to compile without this warning +# being disabled. However, older Clangs fail to recognize the flag. +if { [gcc_major_version "clang-*" "c++"] > 10 } { + lappend flags additional_flags=-Wno-non-c-typedef-for-linkage +} + +if {[prepare_for_testing "failed to prepare" $testfile $srcfile $flags]} { return -1 } From patchwork Mon Nov 7 13:45:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guinevere Larsen X-Patchwork-Id: 60089 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 72188385829E for ; Mon, 7 Nov 2022 13:53:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 72188385829E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1667829232; bh=VzgxAcUXC4PeT68GpE6G5EdrOtUS/AnV4/jeV2plPjM=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=ASw/WwFdem9Xtu4wFoi9wv0dJYiTWJ5Z4gugWW6/XTGCG1uUv1iDS71EwcHsinCkZ ukNqNmtf7itYHusSUYnIXP2e8D73H/8xiTZmPZQD3T7MYVuNpovBDGW+J55tAJD2ku SqRqSabM7lJTxI8SR8DnxuMTRzYXxZujBeD5Z5pc= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org 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 654EF38582A3 for ; Mon, 7 Nov 2022 13:52:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 654EF38582A3 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-208-OCny3eZrNKSrPlSJaDSYJg-1; Mon, 07 Nov 2022 08:52:56 -0500 X-MC-Unique: OCny3eZrNKSrPlSJaDSYJg-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id DD86786F134 for ; Mon, 7 Nov 2022 13:52:55 +0000 (UTC) Received: from fedora.redhat.com (ovpn-193-251.brq.redhat.com [10.40.193.251]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D70522024CBF; Mon, 7 Nov 2022 13:52:54 +0000 (UTC) To: gdb-patches@sourceware.org Cc: Bruno Larsen Subject: [PATCH v2 2/9] gdb/testsuite: enable running gdb.cp/classes.exp with clang Date: Mon, 7 Nov 2022 14:45:58 +0100 Message-Id: <20221107134604.596986-3-blarsen@redhat.com> In-Reply-To: <20221107134604.596986-1-blarsen@redhat.com> References: <20221107134604.596986-1-blarsen@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP, T_FILL_THIS_FORM_SHORT autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org 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: , X-Patchwork-Original-From: Bruno Larsen via Gdb-patches From: Guinevere Larsen Reply-To: Bruno Larsen Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" When attempting to run the gdb.cp/classes.exp test using Clang++, the test fails to prepare with -Wnon-c-typedef-for-linkage like the previously fixed gdb.cp/class2.exp. Upon fixing this, the test shows 5 unexpected failures. One such failures is: ptype/r class class_with_public_typedef type = class class_with_public_typedef { private: int a; public: class_with_public_typedef::INT b; private: typedef int INT; } (gdb) FAIL: gdb.cp/classes.exp: ptype class class_with_public_typedef // wrong access specifier for typedef: private While g++ provided the following output: ptype/r class class_with_public_typedef type = class class_with_public_typedef { private: int a; public: class_with_public_typedef::INT b; typedef int INT; } (gdb) PASS: gdb.cp/classes.exp: ptype class class_with_public_typedef This error happens because Clang does not add DW_AT_accessibility to typedefs inside classes, and without this information GDB defaults to assuming the typedef is private. Since there is nothing that GDB can do about this, these tests have been set as xfails, and Clang bug 57608 has been filed. Bug: https://github.com/llvm/llvm-project/issues/57608 --- gdb/testsuite/gdb.cp/classes.exp | 36 +++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/gdb.cp/classes.exp b/gdb/testsuite/gdb.cp/classes.exp index 7b8b315ac1f..9a947754bb6 100644 --- a/gdb/testsuite/gdb.cp/classes.exp +++ b/gdb/testsuite/gdb.cp/classes.exp @@ -24,7 +24,16 @@ load_lib "cp-support.exp" standard_testfile .cc -if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} { +set flags [list debug c++] +set clang_used false +if { [test_compiler_info "clang-*" "c++"] } { + set clang_used true + if { [gcc_major_version "clang-*" "c++"] >= 11} { + lappend flags additional_flags=-Wno-non-c-typedef-for-linkage + } +} + +if {[prepare_for_testing "failed to prepare" $testfile $srcfile $flags]} { return -1 } @@ -319,6 +328,12 @@ proc test_ptype_class_objects {} { # Classes with typedefs of different access. + # Clang does not add access information for typedefs in classes. + # More information on: https://github.com/llvm/llvm-project/issues/57608 + if {$::clang_used} { + setup_xfail "clang 57608" *-*-* + } + cp_test_ptype_class \ "class class_with_typedefs" "" "class" "class_with_typedefs" \ { @@ -339,6 +354,10 @@ proc test_ptype_class_objects {} { { typedef private "typedef int private_int;" } } + if {$::clang_used} { + setup_xfail "clang 57608" *-*-* + } + cp_test_ptype_class \ "class class_with_public_typedef" "" "class" \ "class_with_public_typedef" { @@ -346,6 +365,11 @@ proc test_ptype_class_objects {} { { field public "class_with_public_typedef::INT b;" } { typedef public "typedef int INT;" } } + + if {$::clang_used} { + setup_xfail "clang 57608" *-*-* + } + cp_test_ptype_class \ "class class_with_protected_typedef" "" "class" \ "class_with_protected_typedef" { @@ -353,6 +377,11 @@ proc test_ptype_class_objects {} { { field protected "class_with_protected_typedef::INT b;" } { typedef protected "typedef int INT;" } } + + if {$::clang_used} { + setup_xfail "clang 57608" *-*-* + } + cp_test_ptype_class \ "struct struct_with_protected_typedef" "" "struct" \ "struct_with_protected_typedef" { @@ -360,6 +389,11 @@ proc test_ptype_class_objects {} { { field protected "struct_with_protected_typedef::INT b;" } { typedef protected "typedef int INT;" } } + + if {$::clang_used} { + setup_xfail "clang 57608" *-*-* + } + cp_test_ptype_class \ "struct struct_with_private_typedef" "" "struct" \ "struct_with_private_typedef" { From patchwork Mon Nov 7 13:45:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guinevere Larsen X-Patchwork-Id: 60091 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 98B64385802B for ; Mon, 7 Nov 2022 13:54:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 98B64385802B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1667829266; bh=OpPcTczyhs8EaedAlej+c86HFIBYuqmhMRMmSPUy8CU=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=KpIvcFgAz+q92Ui7yn3+ka87EmGjjdRoN8Up0wcqdo692GJ4clunGz9abisM2KvLP UPxdtHRvRli3cEkH3PV1IvADSwedpCBUSMq/MDb9fSPlGULfrIG9k9BNKhqWs6q85K reUp9rNVkqzp6tgVOyO1+c5LCBRcIvIJ3ZVpAvGI= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id E3A153858C2D for ; Mon, 7 Nov 2022 13:52:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E3A153858C2D Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-627-qNz3S9W_Oy6OhGRLhwjeVA-1; Mon, 07 Nov 2022 08:52:57 -0500 X-MC-Unique: qNz3S9W_Oy6OhGRLhwjeVA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3A21E857F8F for ; Mon, 7 Nov 2022 13:52:57 +0000 (UTC) Received: from fedora.redhat.com (ovpn-193-251.brq.redhat.com [10.40.193.251]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 281AD2024CB7; Mon, 7 Nov 2022 13:52:56 +0000 (UTC) To: gdb-patches@sourceware.org Cc: Bruno Larsen Subject: [PATCH v2 3/9] gdb/testsuite: account for clang's nested destructor calls on gdb.cp/mb-ctor.exp Date: Mon, 7 Nov 2022 14:45:59 +0100 Message-Id: <20221107134604.596986-4-blarsen@redhat.com> In-Reply-To: <20221107134604.596986-1-blarsen@redhat.com> References: <20221107134604.596986-1-blarsen@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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, 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 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: , X-Patchwork-Original-From: Bruno Larsen via Gdb-patches From: Guinevere Larsen Reply-To: Bruno Larsen Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" When compiling virtual classes's destructors, two versions are compiled, one with a single parameter (this) and the other with 2 parameters (this and vtt). GCC's compilation makes it so either the version with 1 parameter or the one with 2 parameters is called, depending on whether the destructor is being called by the class itself or by an inherited class. On the test gdb.cp/mb-ctor.exp, this means that the breakpoint set at the destructor will be hit 4 times. Clang, on the other hand, makes the single-parameter version call the 2 parameter version, probably in an attempt to reduce the size of the resulting executable. This means that the gdb.cp/mb-ctor.exp will hit 6 breakpoints before finishing, and is the reason why this test was failing. To make this test stop failing, a compiler check is added and another "continue" instruction is issued to account for this difference. --- gdb/testsuite/gdb.cp/mb-ctor.exp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/gdb/testsuite/gdb.cp/mb-ctor.exp b/gdb/testsuite/gdb.cp/mb-ctor.exp index 5a3c0a4a90f..05dbf507e90 100644 --- a/gdb/testsuite/gdb.cp/mb-ctor.exp +++ b/gdb/testsuite/gdb.cp/mb-ctor.exp @@ -25,6 +25,12 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} { return -1 } +if {[test_compiler_info {clang-*-*} c++]} { + set using_clang true +} else { + set using_clang false +} + if ![runto_main] then { perror "couldn't run to breakpoint" return @@ -71,6 +77,13 @@ gdb_continue_to_breakpoint "set breakpoint here, second dynamic time"\ gdb_test "continue" ".*Breakpoint.*~Derived.*" "Run to dynamic destructor v1" +# Clang makes Derived::~Derived(this) call Derived::~Derives(this, vtt) +# whereas gcc puts all the logic necessary on both functions. +if {$using_clang} { + gdb_test "continue" ".*Breakpoint.*~Derived.*"\ + "clang's nested dynamic destructor call" +} + gdb_test "continue" ".*Breakpoint.*~Derived.*" "Run to dynamic destructor v2" gdb_test "continue" \ @@ -81,6 +94,11 @@ gdb_test "continue" \ ".*Breakpoint.*~Derived.*" \ "run to breakpoint 3 v2" +if {$using_clang} { + gdb_test "continue" ".*Breakpoint.*~Derived.*"\ + "clang's nested destructor call" +} + gdb_test "continue" \ ".*exited normally.*" \ "run to exit" From patchwork Mon Nov 7 13:46:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guinevere Larsen X-Patchwork-Id: 60093 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5F6373857C7E for ; Mon, 7 Nov 2022 13:54:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5F6373857C7E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1667829294; bh=W04k1nxACGbd8HJ8KjDvHHWA4dNh24cBlLsev2Qh3DI=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=EZi3FSySc+LCDAvTO0/k/9iF0KlmmOkxbz/Jie6+j+4tH0dKjMYASmkF0cOXEJpCD DprVRZBWzp/nwroO5lxR3sd0Wywz9saiYazTlYKe6+6KZZuR+HDEmoZSJAisa9y3eZ R7XI27oEV82Q4FbGKwbcjViwrWnKFpnjjFGZnDXQ= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org 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 4CBFD385800E for ; Mon, 7 Nov 2022 13:53:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4CBFD385800E Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-296-A2fvBQ6gNK6WvPoZl5ZSbg-1; Mon, 07 Nov 2022 08:52:59 -0500 X-MC-Unique: A2fvBQ6gNK6WvPoZl5ZSbg-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 882C22A59544 for ; Mon, 7 Nov 2022 13:52:58 +0000 (UTC) Received: from fedora.redhat.com (ovpn-193-251.brq.redhat.com [10.40.193.251]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CCD8E2024CB7; Mon, 7 Nov 2022 13:52:57 +0000 (UTC) To: gdb-patches@sourceware.org Cc: Bruno Larsen Subject: [PATCH v2 4/9] gdb/testsuite: add XFAIL to gdb.cp/derivation.exp when using Clang Date: Mon, 7 Nov 2022 14:46:00 +0100 Message-Id: <20221107134604.596986-5-blarsen@redhat.com> In-Reply-To: <20221107134604.596986-1-blarsen@redhat.com> References: <20221107134604.596986-1-blarsen@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, 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 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: , X-Patchwork-Original-From: Bruno Larsen via Gdb-patches From: Guinevere Larsen Reply-To: Bruno Larsen Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" When running gdb.cp/derivation.exp using Clang, we get an unexpected failure when printing the type of a class with an internal typedef. This happens because Clang doesn't add accessibility information for typedefs inside classes (see https://github.com/llvm/llvm-project/issues/57608 for more info). To help with Clang testing, an XFAIL was added to this test. --- gdb/testsuite/gdb.cp/derivation.exp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gdb/testsuite/gdb.cp/derivation.exp b/gdb/testsuite/gdb.cp/derivation.exp index c95fef004b5..f49ab208ac9 100644 --- a/gdb/testsuite/gdb.cp/derivation.exp +++ b/gdb/testsuite/gdb.cp/derivation.exp @@ -77,6 +77,10 @@ gdb_test "up" ".*main.*" "up from marker1" gdb_test "print a_instance" "\\$\[0-9\]+ = \{a = 1, aa = 2\}" "print value of a_instance" +# Clang does not add accessibility information for typedefs inside classes. +if {[test_compiler_info {clang*} c++]} { + setup_xfail "clang 57608" *-*-* +} cp_test_ptype_class \ "a_instance" "" "class" "A" \ { From patchwork Mon Nov 7 13:46:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guinevere Larsen X-Patchwork-Id: 60088 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D56753857BA3 for ; Mon, 7 Nov 2022 13:53:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D56753857BA3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1667829218; bh=Wy6Bs5HXf9zqaudINDG1WXCE+W2bwsCCiUgLfq68WZU=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=DhWRa1Z/+BHqWJ5i+gdRIuSVaBe7cRjn9LWupjIB8V1vmya+e+OJuSE1ZZ3Q2rYxE YgXvM+pZoI7HEq9Ls+0JwI4KmJSLj9CmSbIJ9YqXs85+vJgsWIum+RXhdofPZtW9dx +XmEye6SnzOUlTlSMma/jsaW+nkAfsPEKQcIBkKE= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 526F43858027 for ; Mon, 7 Nov 2022 13:53:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 526F43858027 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-671-6_XKf3-yPau2gZR9x0FuXg-1; Mon, 07 Nov 2022 08:52:59 -0500 X-MC-Unique: 6_XKf3-yPau2gZR9x0FuXg-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 87B8D3C10EC7 for ; Mon, 7 Nov 2022 13:52:59 +0000 (UTC) Received: from fedora.redhat.com (ovpn-193-251.brq.redhat.com [10.40.193.251]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 02AD82027063; Mon, 7 Nov 2022 13:52:58 +0000 (UTC) To: gdb-patches@sourceware.org Cc: Bruno Larsen Subject: [PATCH v2 5/9] gdb/testsuite: allow for Clang style destructors on gdb.cp/m-static.exp Date: Mon, 7 Nov 2022 14:46:01 +0100 Message-Id: <20221107134604.596986-6-blarsen@redhat.com> In-Reply-To: <20221107134604.596986-1-blarsen@redhat.com> References: <20221107134604.596986-1-blarsen@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, 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 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: , X-Patchwork-Original-From: Bruno Larsen via Gdb-patches From: Guinevere Larsen Reply-To: Bruno Larsen Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" when running gdb.cp/m-static.exp using Clang, we get the following failures: print test1.~gnu_obj_1^M $6 = {void (gnu_obj_1 * const)} 0x555555555470 ^M (gdb) FAIL: gdb.cp/m-static.exp: simple object instance, print destructor ptype test1.~gnu_obj_1^M type = void (gnu_obj_1 * const)^M (gdb) FAIL: gdb.cp/m-static.exp: simple object instance, ptype destructor print test1.'~gnu_obj_1'^M $7 = {void (gnu_obj_1 * const)} 0x555555555470 ^M (gdb) FAIL: gdb.cp/m-static.exp: simple object instance, print quoted destructor This is because the test is expecting an extra integer parameter on the destructor. Looking at the debuginfo, it seems that there is nothing actually wrong with this output, so these tests were changed to test multiple possible regexps. --- gdb/testsuite/gdb.cp/m-static.exp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/gdb/testsuite/gdb.cp/m-static.exp b/gdb/testsuite/gdb.cp/m-static.exp index 979de23a44f..1239dbc0f1d 100644 --- a/gdb/testsuite/gdb.cp/m-static.exp +++ b/gdb/testsuite/gdb.cp/m-static.exp @@ -102,15 +102,16 @@ if { [is_aarch32_target] } { {type = void \(single_constructor \* const\)} \ "simple object class, ptype constructor" - gdb_test "print test1.~gnu_obj_1" \ - { = {void \(gnu_obj_1 \* const, int\)} 0x[0-9a-f]+ } \ + gdb_test "print test1.~gnu_obj_1"\ + { = {void \(gnu_obj_1 \* const(?:, int)?\)} 0x[0-9a-f]+ }\ "simple object instance, print destructor" - gdb_test "ptype test1.~gnu_obj_1" \ - {type = void \(gnu_obj_1 \* const, int\)} \ + + gdb_test "ptype test1.~gnu_obj_1"\ + {type = void \(gnu_obj_1 \* const(?:, int)?\)}\ "simple object instance, ptype destructor" gdb_test "print test1.'~gnu_obj_1'" \ - { = {void \(gnu_obj_1 \*( const)?, int\)} 0x[0-9a-f]+ } \ + { = {void \(gnu_obj_1 \*( const)?(?:, int)?\)} 0x[0-9a-f]+ } \ "simple object instance, print quoted destructor" gdb_test "ptype gnu_obj_1::'~gnu_obj_1'" \ From patchwork Mon Nov 7 13:46:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guinevere Larsen X-Patchwork-Id: 60090 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 87716385843B for ; Mon, 7 Nov 2022 13:54:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 87716385843B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1667829260; bh=/jbdA+zlvrRNvfgLVlYxY3CA4CeXj/ubPDOYcGtbObM=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=r6yvBcIwMekYyba53MOAQ/RYUz+iVAKYw3Ej/LlE9aVsydU4gABG1X4FWglpPzmMT 6fDMGWaZ+t0+68cKoBq6pBnHjP3q18r6bgFhSVACyxOcODyVXxEgvyicWK+mjLp2q5 ua4Lh9FGV0QofRpK1fc8sL+k6W7JzG++oUuyaBAE= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org 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 F06B0385828A for ; Mon, 7 Nov 2022 13:53:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org F06B0385828A Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-516-OXT_4lqaP4C2WSwx5JFerg-1; Mon, 07 Nov 2022 08:53:00 -0500 X-MC-Unique: OXT_4lqaP4C2WSwx5JFerg-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 744482A59540 for ; Mon, 7 Nov 2022 13:53:00 +0000 (UTC) Received: from fedora.redhat.com (ovpn-193-251.brq.redhat.com [10.40.193.251]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C8AAF2027063; Mon, 7 Nov 2022 13:52:59 +0000 (UTC) To: gdb-patches@sourceware.org Cc: Bruno Larsen Subject: [PATCH v2 6/9] gdb/testsuite: skip gdb.cp/anon-struct.exp when using Clang Date: Mon, 7 Nov 2022 14:46:02 +0100 Message-Id: <20221107134604.596986-7-blarsen@redhat.com> In-Reply-To: <20221107134604.596986-1-blarsen@redhat.com> References: <20221107134604.596986-1-blarsen@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.2 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 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: , X-Patchwork-Original-From: Bruno Larsen via Gdb-patches From: Guinevere Larsen Reply-To: Bruno Larsen Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" 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). With these 2 things together, GDB is unable to refer to any of them, so there is no way to pass any of the tests of gdb.cp/anon-struct.exp Since this isn't a bug on Clang or GDB according to the DWARF specifications as DW_AT_name is optional for all DIEs, the test was marked 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 | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gdb/testsuite/gdb.cp/anon-struct.exp b/gdb/testsuite/gdb.cp/anon-struct.exp index 2c709ab9ecc..2113957fed0 100644 --- a/gdb/testsuite/gdb.cp/anon-struct.exp +++ b/gdb/testsuite/gdb.cp/anon-struct.exp @@ -14,12 +14,22 @@ # 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 ability to refer to linkage names +# for types and functions within anonymous structures. + standard_testfile .cc if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug c++}] } { return -1 } +# Clang doesn't add any names for functions within anonymous structures, +# so there is no way to try and refer to them inside GDB. +if {[test_compiler_info clang-*-* c++]} { + untested "clang does not use linkage name in this case" + return +} + 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" From patchwork Mon Nov 7 13:46:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guinevere Larsen X-Patchwork-Id: 60092 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 520FC3857C4B for ; Mon, 7 Nov 2022 13:54:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 520FC3857C4B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1667829288; bh=OP+ep0HYU5s8gY2BlV8/66sBvUBrd37pG9iZUAVcTQo=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=sry78vhU11vUNIa115q0SvHm0DVS+ZlPYH9dCGDLNOGioq1yWyWwUggsyi1U1X5Hn zrXtC0jhEfadgUpfhR48XmNHO2KmaIlEomDH7hKGYI43uAyzjEbYw0SK6nsn6PIvRe UI1SlkgiYbuxaRZwhliZJNNVim0fBC/cafV6UIhc= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org 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 4A33338582A8 for ; Mon, 7 Nov 2022 13:53:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4A33338582A8 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-544-xuRpgyr_PASxsQ2__1F6WQ-1; Mon, 07 Nov 2022 08:53:01 -0500 X-MC-Unique: xuRpgyr_PASxsQ2__1F6WQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 46CF3101A528 for ; Mon, 7 Nov 2022 13:53:01 +0000 (UTC) Received: from fedora.redhat.com (ovpn-193-251.brq.redhat.com [10.40.193.251]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B42682023272; Mon, 7 Nov 2022 13:53:00 +0000 (UTC) To: gdb-patches@sourceware.org Cc: Bruno Larsen Subject: [PATCH v2 7/9] gdb/testsuite: disable some tests of gdb.cp/typeid.exp when using Clang Date: Mon, 7 Nov 2022 14:46:03 +0100 Message-Id: <20221107134604.596986-8-blarsen@redhat.com> In-Reply-To: <20221107134604.596986-1-blarsen@redhat.com> References: <20221107134604.596986-1-blarsen@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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, 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 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: , X-Patchwork-Original-From: Bruno Larsen via Gdb-patches From: Guinevere Larsen Reply-To: Bruno Larsen Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" Since Clang chooses to not add any debug information for base types, expecting it to be included with libraries' informations, gdb.cp/typeid.exp will always fail if the program hasn't started. This commit fixes that by making it so when using Clang, the base type variables aren't tested. --- gdb/testsuite/gdb.cp/typeid.exp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/gdb.cp/typeid.exp b/gdb/testsuite/gdb.cp/typeid.exp index 6411217191a..fd8e96276c5 100644 --- a/gdb/testsuite/gdb.cp/typeid.exp +++ b/gdb/testsuite/gdb.cp/typeid.exp @@ -29,8 +29,16 @@ proc do_typeid_tests {started} { # We might see the standard type or gdb's internal type. set type_re "(std::type_info|gdb_gnu_v3_type_info)" + set var {ca b} + if {$started || ![test_compiler_info clang-*-* c++]} { + # Clang doesn't place type information for the base types in + # the executable, and relies on this being linked in from the + # standard library. As a result, type information for these + # variables is only available once the inferior is started. + lappend var i cp ccp + } - foreach simple_var {i cp ccp ca b} { + foreach simple_var $var { gdb_test "print &typeid($simple_var)" \ " = \\($type_re \\*\\) $hex.*" From patchwork Mon Nov 7 13:46:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guinevere Larsen X-Patchwork-Id: 60094 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9C34B3857BB3 for ; Mon, 7 Nov 2022 13:55:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9C34B3857BB3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1667829326; bh=IC1CC5gnBZ3CzGtSORhd6CEzZiuH2Jk1MiBkDKBatVw=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=DBZ/1Huh2yPNFB2rpM/+n2lPEJx4zMxItkiVcC4j2+X/MBAyMfAx98BQR1+s84YLz z6uYPuMp9c0HrtcbW/VLAg1GkM48g0d7Tpjc0noMAdaoaZyy1wCbEbS/qgyax8oN3l lVTHN3A38EY+4wWnCXlQDQVJhLMLUYJqd030yxc8= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id C8F3C3858C2F for ; Mon, 7 Nov 2022 13:53:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C8F3C3858C2F Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-175-njW7cve-MhKpFqMXFizu-w-1; Mon, 07 Nov 2022 08:53:02 -0500 X-MC-Unique: njW7cve-MhKpFqMXFizu-w-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 186241C07592 for ; Mon, 7 Nov 2022 13:53:02 +0000 (UTC) Received: from fedora.redhat.com (ovpn-193-251.brq.redhat.com [10.40.193.251]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8644A2028DC1; Mon, 7 Nov 2022 13:53:01 +0000 (UTC) To: gdb-patches@sourceware.org Cc: Bruno Larsen Subject: [PATCH v2 8/9] gdb/testsuite: remove XFAIL on gdb.cp/temargs.exp Date: Mon, 7 Nov 2022 14:46:04 +0100 Message-Id: <20221107134604.596986-9-blarsen@redhat.com> In-Reply-To: <20221107134604.596986-1-blarsen@redhat.com> References: <20221107134604.596986-1-blarsen@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, 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 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: , X-Patchwork-Original-From: Bruno Larsen via Gdb-patches From: Guinevere Larsen Reply-To: Bruno Larsen Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" gdb.cp/temargs.exp last 2 tests always setup an XFAILs, despite checking for old gcc versions. However, Clang does not fail in this test, turning into XPASSes and slighty annoying when comparing between compilers. To change this, make the xfails only happen if we using gcc. --- gdb/testsuite/gdb.cp/temargs.exp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gdb/testsuite/gdb.cp/temargs.exp b/gdb/testsuite/gdb.cp/temargs.exp index 05fd902bb83..2a927d8651b 100644 --- a/gdb/testsuite/gdb.cp/temargs.exp +++ b/gdb/testsuite/gdb.cp/temargs.exp @@ -46,6 +46,8 @@ if {[test_compiler_info {gcc-[0-3]-*}] set have_pr_45024_fixed 0 } +set using_gcc [test_compiler_info gcc-*-*] + set line [gdb_get_line_number "Breakpoint 1" $srcfile] gdb_test "break $srcfile:$line" "Breakpoint 2.*" \ "set first breakpoint for temargs" @@ -190,10 +192,10 @@ gdb_test "print F" "&S::somefunc" "test value of F in k2_m" gdb_continue_to_breakpoint "continue to sixth breakpoint for temargs" if $have_older_template_gcc { setup_xfail "*-*-*" -} else { setup_xfail gcc/49546 "*-*-*" } +} elseif $using_gcc { setup_xfail gcc/49546 "*-*-*" } gdb_test "ptype F" {type = void \(\*\)\(int\)} "test type of F in k3_m" if $have_older_template_gcc { setup_xfail "*-*-*" -} else { setup_xfail gcc/49546 "*-*-*" } +} elseif $using_gcc { setup_xfail gcc/49546 "*-*-*" } gdb_test "print F" { = \(void \(\*\)\(int\)\) 0x[0-9a-f]+ } \ "test value of F in k3_m" From patchwork Mon Nov 7 13:46:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guinevere Larsen X-Patchwork-Id: 60095 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 474B73857C49 for ; Mon, 7 Nov 2022 13:55:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 474B73857C49 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1667829355; bh=5/sl9GbLsUTmLL8z4oorPemx/b8S+pD0cRhU4wkN3og=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=Z1ArPdf+d8wsi8zET1LPNk7cmDO1sKCM3O/vRD9PJB0/I9eGHwnRkrlfX9b3DZ622 QdOMoEj/mX90Y5UJcXKUPR01cYpLwdoXsZm1KgqrN1PPAd+uLF1K6ebNx20X1R2EGg s5SayR0HevvseWpytATFNNpnZWbvTxjTTVoHP/00= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id B7E1E3858406 for ; Mon, 7 Nov 2022 13:53:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B7E1E3858406 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-271-I5_QT0b7NWy6Snr592FNlA-1; Mon, 07 Nov 2022 08:53:03 -0500 X-MC-Unique: I5_QT0b7NWy6Snr592FNlA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id F2A99101A528 for ; Mon, 7 Nov 2022 13:53:02 +0000 (UTC) Received: from fedora.redhat.com (ovpn-193-251.brq.redhat.com [10.40.193.251]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6D0202027063; Mon, 7 Nov 2022 13:53:02 +0000 (UTC) To: gdb-patches@sourceware.org Cc: Bruno Larsen Subject: [PATCH v2 9/9] gdb/testsuite: disable gdb.cp/call-method-register.exp when not using gcc Date: Mon, 7 Nov 2022 14:46:05 +0100 Message-Id: <20221107134604.596986-10-blarsen@redhat.com> In-Reply-To: <20221107134604.596986-1-blarsen@redhat.com> References: <20221107134604.596986-1-blarsen@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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, 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 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: , X-Patchwork-Original-From: Bruno Larsen via Gdb-patches From: Guinevere Larsen Reply-To: Bruno Larsen Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" The test gdb.cp/call-method-register.exp assumes that the class will be placed on a register. However, this keyword has been deprecated since C++11, and Clang, for instance, does not feel the need to follow it. Since this test is not usable without this working, this commit marks this test as untested. --- gdb/testsuite/gdb.cp/call-method-register.exp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gdb/testsuite/gdb.cp/call-method-register.exp b/gdb/testsuite/gdb.cp/call-method-register.exp index a1e6498d66c..a98b11e4c11 100644 --- a/gdb/testsuite/gdb.cp/call-method-register.exp +++ b/gdb/testsuite/gdb.cp/call-method-register.exp @@ -26,6 +26,11 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} { return -1 } +if {![test_compiler_info gcc-*-* c++]} { + untested "test relies on a gcc extension" + return +} + proc test_call_register_class {} { global gdb_prompt