From patchwork Tue Oct 4 17:07:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guinevere Larsen X-Patchwork-Id: 58349 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 3D958385C418 for ; Tue, 4 Oct 2022 17:08:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3D958385C418 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1664903316; bh=9+GSLNESTECSswkU5HjyE7+LUihfxyPysbzmRrsK0+U=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=gyOjn3V862GaNN225arxOewirIjDa7Xa3RSfi3Ebi5PlDnXRY6u3aDGmt7mDkkriu nknpsa8gPBlNZueO2XaRX0u5BN5FTBEF+rxsyvhlSSDweCx9fxoGxd697pM8CaXtCr /4LeUFE56PYucU2jywDXl7XF5ZzCIuKcCRzwvvC4= 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 75B503858436 for ; Tue, 4 Oct 2022 17:08:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 75B503858436 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-47-tUM89mMRNSqcIHnxfqJf0A-1; Tue, 04 Oct 2022 13:08:07 -0400 X-MC-Unique: tUM89mMRNSqcIHnxfqJf0A-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 63663101A267 for ; Tue, 4 Oct 2022 17:08:07 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.40.192.57]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A84A8492B04; Tue, 4 Oct 2022 17:08:06 +0000 (UTC) To: gdb-patches@sourceware.org Subject: [PATCH 01/11] gdb/testsuite: ignore Non-C-typedefs for gdb.cp/class2.exp Date: Tue, 4 Oct 2022 19:07:36 +0200 Message-Id: <20221004170747.154307-2-blarsen@redhat.com> In-Reply-To: <20221004170747.154307-1-blarsen@redhat.com> References: <20221004170747.154307-1-blarsen@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.4 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_LOW, 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. The test shows no failures with this change. --- gdb/testsuite/gdb.cp/class2.exp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdb/testsuite/gdb.cp/class2.exp b/gdb/testsuite/gdb.cp/class2.exp index 32f9dfc18a5..e1e4ad0fae6 100644 --- a/gdb/testsuite/gdb.cp/class2.exp +++ b/gdb/testsuite/gdb.cp/class2.exp @@ -18,7 +18,7 @@ if { [skip_cplus_tests] } { return } standard_testfile .cc -if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} { +if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++ additional_flags=-Wno-non-c-typedef-for-linkage}]} { return -1 } From patchwork Tue Oct 4 17:07:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guinevere Larsen X-Patchwork-Id: 58350 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 4C15C38582A4 for ; Tue, 4 Oct 2022 17:08:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4C15C38582A4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1664903324; bh=/jX1agVMbfuVMDSwYEOGNlrIkIEWKAXK4OSWxKSYav8=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=hSsuYqkTl0SKt+76gIoZhVxvwCzXk36KtWAGHavCcxN0k7q/YnDyG+sQU0+wM76Ge gi7GLQFdAyTWIoYqy3cbtL3uGzHiB3Y/0hz9mG9C5O5NRxbLctqrKiIgqCmbfvNHM4 Y4PQpTu0r022yJ/NmbxMucauEXYEUvemNakcSpqo= 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 78F1F385828F for ; Tue, 4 Oct 2022 17:08:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 78F1F385828F 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-149-4KMJdqDTMum6xXPveM9d_g-1; Tue, 04 Oct 2022 13:08:09 -0400 X-MC-Unique: 4KMJdqDTMum6xXPveM9d_g-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B80F92999B3E for ; Tue, 4 Oct 2022 17:08:08 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.40.192.57]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0638E492B04; Tue, 4 Oct 2022 17:08:07 +0000 (UTC) To: gdb-patches@sourceware.org Subject: [PATCH 02/11] gdb/testsuite: enable running gdb.cp/classes.exp with clang Date: Tue, 4 Oct 2022 19:07:37 +0200 Message-Id: <20221004170747.154307-3-blarsen@redhat.com> In-Reply-To: <20221004170747.154307-1-blarsen@redhat.com> References: <20221004170747.154307-1-blarsen@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.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_LOW, 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 a clang bug has been filed. --- gdb/testsuite/gdb.cp/classes.exp | 33 +++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/gdb.cp/classes.exp b/gdb/testsuite/gdb.cp/classes.exp index 7b8b315ac1f..3f3e587803c 100644 --- a/gdb/testsuite/gdb.cp/classes.exp +++ b/gdb/testsuite/gdb.cp/classes.exp @@ -24,14 +24,20 @@ load_lib "cp-support.exp" standard_testfile .cc -if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} { +if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++ additional_flags=-Wno-non-c-typedef-for-linkage}]} { return -1 } + # Test ptype of class objects. proc test_ptype_class_objects {} { + if {[test_compiler_info {clang*}]} { + set clang_used true + } else { + set clang_used false + } # Simple type. cp_test_ptype_class \ @@ -319,6 +325,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 +351,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 +362,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 +374,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 +386,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 Tue Oct 4 17:07:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guinevere Larsen X-Patchwork-Id: 58351 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 2E2423854148 for ; Tue, 4 Oct 2022 17:09:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2E2423854148 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1664903341; bh=7Ci4qVwIjGYqdcpzocb5jJJVVPR62ekMvvQbJzuq5hM=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=TuIr9OA8H1oWA0kOzp7UlaNWaz9q54PXNOY2HtTWW32aVKD4AYQ8xlemffHRueNGZ 08SHS45+5v8l2CxxXKCrgBUARJavfyhm1iMUbQbv2LXlRXpkPj5ZqjXA8ObVnoJIag MKnl9YZ9lH6PI4RMRvV2OXAeN9i0KzQCsvF3BMU4= 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 DA3E43858283 for ; Tue, 4 Oct 2022 17:08:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org DA3E43858283 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-583-8ETqkuQlNfKTcYWwclABPw-1; Tue, 04 Oct 2022 13:08:10 -0400 X-MC-Unique: 8ETqkuQlNfKTcYWwclABPw-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B0D0F3826241 for ; Tue, 4 Oct 2022 17:08:09 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.40.192.57]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 24802492B04; Tue, 4 Oct 2022 17:08:08 +0000 (UTC) To: gdb-patches@sourceware.org Subject: [PATCH 03/11] gdb/testsuite: account for clang's recursive destructor calls on gdb.cp/mb-ctor.exp Date: Tue, 4 Oct 2022 19:07:38 +0200 Message-Id: <20221004170747.154307-4-blarsen@redhat.com> In-Reply-To: <20221004170747.154307-1-blarsen@redhat.com> References: <20221004170747.154307-1-blarsen@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.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_LOW, 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 | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/gdb/testsuite/gdb.cp/mb-ctor.exp b/gdb/testsuite/gdb.cp/mb-ctor.exp index 5a3c0a4a90f..6aadecdd27d 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-*-*}]} { + set using_clang true +} else { + set using_clang false +} + if ![runto_main] then { perror "couldn't run to breakpoint" return @@ -71,6 +77,12 @@ 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 recursive dynamic destructor call" +} + gdb_test "continue" ".*Breakpoint.*~Derived.*" "Run to dynamic destructor v2" gdb_test "continue" \ @@ -81,6 +93,10 @@ gdb_test "continue" \ ".*Breakpoint.*~Derived.*" \ "run to breakpoint 3 v2" +if {$using_clang} { + gdb_test "continue" ".*Breakpoint.*~Derived.*" "clang's recursive destructor call" +} + gdb_test "continue" \ ".*exited normally.*" \ "run to exit" From patchwork Tue Oct 4 17:07:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guinevere Larsen X-Patchwork-Id: 58353 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 12217385357C for ; Tue, 4 Oct 2022 17:09:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 12217385357C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1664903355; bh=KjLqIeExHFjzOfrJ/WTnaRcOpDwhadnu3BF4AQ80UhI=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=APLcRTzeYZ0u9Qm09Dik/hqaNgWUcVP6SZjYX609/0I5Jca8aCRJLdlMy34PpNLGw nGCpGBVDODH1ox6oNCe5oRBOtdqHGIkooXobwx82J1jjQqWU3Mo0GRXKAKju04IDUP AW/m7HO3+BFYt7uK8FEekk1qrVn31dK7UC5IIi/g= 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 4C09D3858D32 for ; Tue, 4 Oct 2022 17:08:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4C09D3858D32 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-593-0Q340RViPZacvgORWq5auQ-1; Tue, 04 Oct 2022 13:08:10 -0400 X-MC-Unique: 0Q340RViPZacvgORWq5auQ-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7CDE685A5B6 for ; Tue, 4 Oct 2022 17:08:10 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.40.192.57]) by smtp.corp.redhat.com (Postfix) with ESMTPS id ED67D492B04; Tue, 4 Oct 2022 17:08:09 +0000 (UTC) To: gdb-patches@sourceware.org Subject: [PATCH 4/9] gdb/testsuite: add XFAIL to gdb.cp/derivation.exp when using clang Date: Tue, 4 Oct 2022 19:07:39 +0200 Message-Id: <20221004170747.154307-5-blarsen@redhat.com> In-Reply-To: <20221004170747.154307-1-blarsen@redhat.com> References: <20221004170747.154307-1-blarsen@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.4 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_LOW, 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..2283e5b3616 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*}]} { + setup_xfail "clang 57608" *-*-* +} cp_test_ptype_class \ "a_instance" "" "class" "A" \ { From patchwork Tue Oct 4 17:07:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guinevere Larsen X-Patchwork-Id: 58352 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 82EDD385356C for ; Tue, 4 Oct 2022 17:09:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 82EDD385356C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1664903352; bh=odiGYNTYSkf1mQJgjSZYVd6a1VTjDwBbBen2E0AaBPc=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=I19rwbA9CiHA8JFIbbcViroYzOpnDZ+UrFoUor9P/tNzegMK0CsB0RfseAw6ig/4h 48+QqzV8v2Nl/9epJPneM7LTvU6FYtc2YC8FIlB7dgf7USIGv7OLSe3ZTr0G/A+9Rz qRiGe7BJ2DmseEFlm44/TBTHe2Q5bzbCeIfvpdXw= 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 66C013858022 for ; Tue, 4 Oct 2022 17:08:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 66C013858022 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-245-XoSb3UAXP6GijJ0L5cfDog-1; Tue, 04 Oct 2022 13:08:12 -0400 X-MC-Unique: XoSb3UAXP6GijJ0L5cfDog-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 74E913C0CD3F for ; Tue, 4 Oct 2022 17:08:12 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.40.192.57]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9735D492B04; Tue, 4 Oct 2022 17:08:11 +0000 (UTC) To: gdb-patches@sourceware.org Subject: [PATCH 05/11] gdb/testsuite: allow for clang style destructors on gdb.cp/m-static.exp Date: Tue, 4 Oct 2022 19:07:41 +0200 Message-Id: <20221004170747.154307-7-blarsen@redhat.com> In-Reply-To: <20221004170747.154307-1-blarsen@redhat.com> References: <20221004170747.154307-1-blarsen@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.9 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_LOW, 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 | 36 ++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/gdb/testsuite/gdb.cp/m-static.exp b/gdb/testsuite/gdb.cp/m-static.exp index 979de23a44f..332e1cbe1f9 100644 --- a/gdb/testsuite/gdb.cp/m-static.exp +++ b/gdb/testsuite/gdb.cp/m-static.exp @@ -102,16 +102,32 @@ 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]+ } \ - "simple object instance, print destructor" - 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]+ } \ - "simple object instance, print quoted destructor" + gdb_test_multiple "print test1.~gnu_obj_1" "simple object instance, print destructor" { + -re -wrap { = {void \(gnu_obj_1 \* const, int\)} 0x[0-9a-f]+ } { + pass $gdb_test_name + } + -re -wrap { = {void \(gnu_obj_1 \* const\)} 0x[0-9a-f]+ } { + pass $gdb_test_name + } + } + + gdb_test_multiple "ptype test1.~gnu_obj_1" "simple object instance, ptype destructor" { + -re -wrap {type = void \(gnu_obj_1 \* const, int\)} { + pass $gdb_test_name + } + -re -wrap {type = void \(gnu_obj_1 \* const\)} { + pass $gdb_test_name + } + } + + gdb_test_multiple "print test1.'~gnu_obj_1'" "simple object instance, print quoted destructor" { + -re -wrap { = {void \(gnu_obj_1 \*( const)?, int\)} 0x[0-9a-f]+ } { + pass $gdb_test_name + } + -re -wrap { = {void \(gnu_obj_1 \*( const)?\)} 0x[0-9a-f]+ } { + pass $gdb_test_name + } + } gdb_test "ptype gnu_obj_1::'~gnu_obj_1'" \ {type = void \(gnu_obj_1 \* const\)} \ From patchwork Tue Oct 4 17:07:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guinevere Larsen X-Patchwork-Id: 58356 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 CCA0138515D0 for ; Tue, 4 Oct 2022 17:09:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CCA0138515D0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1664903382; bh=jZUJA6PKWDoWCJY235cfTtPalYQJ8wyz4LzV/xds0p8=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=rwX264zCI2moHuRbm4r4SNNcHShK5e9KtU64Tw0JmS8kv/SE2x0F2ZfyaT9nFPZ44 onsMA2Vv6W8q0frwxEf2QOwF0nw7MxnL0ZEOhQnN8kHMZwDAeIlPxHk+R9/klCLjEa dIQYNkZqSF4LsZodMELna82CaW4kPtfjx1XVyIk8= 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 2B3A93858014 for ; Tue, 4 Oct 2022 17:08:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2B3A93858014 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-637-7SY2q7-1PHy2GAPXlTvaeg-1; Tue, 04 Oct 2022 13:08:13 -0400 X-MC-Unique: 7SY2q7-1PHy2GAPXlTvaeg-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5C2F81C05146 for ; Tue, 4 Oct 2022 17:08:13 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.40.192.57]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CD4F6492B04; Tue, 4 Oct 2022 17:08:12 +0000 (UTC) To: gdb-patches@sourceware.org Subject: [PATCH 06/11] gdb/testsuite: add XFAIL to gdb.cp/ptype-flags.exp when using clang Date: Tue, 4 Oct 2022 19:07:42 +0200 Message-Id: <20221004170747.154307-8-blarsen@redhat.com> In-Reply-To: <20221004170747.154307-1-blarsen@redhat.com> References: <20221004170747.154307-1-blarsen@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.9 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_LOW, 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/ptype-flags.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/ptype-flags.exp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/gdb/testsuite/gdb.cp/ptype-flags.exp b/gdb/testsuite/gdb.cp/ptype-flags.exp index f88c83e03ce..e8d3f285803 100644 --- a/gdb/testsuite/gdb.cp/ptype-flags.exp +++ b/gdb/testsuite/gdb.cp/ptype-flags.exp @@ -30,11 +30,18 @@ if ![runto_main] then { return } +if {[test_compiler_info {clang-*-*}]} { + set using_clang true +} else { + set using_clang false +} + gdb_test_no_output "set language c++" "" gdb_test_no_output "set width 0" "" proc do_check_holder {name {flags ""} {show_typedefs 1} {show_methods 1} {raw 0}} { + global using_clang set contents { { base "public Base" } @@ -49,6 +56,11 @@ proc do_check_holder {name {flags ""} {show_typedefs 1} {show_methods 1} } if {$show_typedefs} { + # Clang does not add accessibility information for typedefs: + # https://github.com/llvm/llvm-project/issues/57608 + if {$using_clang} { + setup_xfail "clang 57608" *-*-* + } lappend contents { typedef public "typedef Simple > Z;" } } From patchwork Tue Oct 4 17:07:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guinevere Larsen X-Patchwork-Id: 58355 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 9F95B3851C3A for ; Tue, 4 Oct 2022 17:09:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9F95B3851C3A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1664903380; bh=PZNhgooDnJltInvJQJA1UVZGYGpyva1A2vw2ZRUJJ04=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=wnUcpU6p631MT+Acl8YhYgVDIVDut+Z1do8+BuCedhk0GPIYa/mSJwvqa5ocjvY32 r5xuJYmL8QrUKQJUamWTxhJebATCEQ04pphCFgP+HgVQNNhCBwsRLiapf0gANdd7uF Hb148E3ZfLTNTO20LqVu1275oZZlonj5boSsNiqE= 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 70C053857C4D for ; Tue, 4 Oct 2022 17:08:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 70C053857C4D 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-313-vAwl5RmtNqqM8taHkq-oag-1; Tue, 04 Oct 2022 13:08:15 -0400 X-MC-Unique: vAwl5RmtNqqM8taHkq-oag-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C22AA3826240 for ; Tue, 4 Oct 2022 17:08:14 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.40.192.57]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E1D2D492B04; Tue, 4 Oct 2022 17:08:13 +0000 (UTC) To: gdb-patches@sourceware.org Subject: [PATCH 07/11] gdb/testsuite: skip gdb.cp/anon-struct.exp when using clang Date: Tue, 4 Oct 2022 19:07:43 +0200 Message-Id: <20221004170747.154307-9-blarsen@redhat.com> In-Reply-To: <20221004170747.154307-1-blarsen@redhat.com> References: <20221004170747.154307-1-blarsen@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.9 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_LOW, 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). 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. + standard_testfile .cc if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug c++}] } { return -1 } +if {[test_compiler_info clang-*-*]} { + 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 Tue Oct 4 17:07:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guinevere Larsen X-Patchwork-Id: 58358 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 EED873853808 for ; Tue, 4 Oct 2022 17:10:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EED873853808 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1664903409; bh=sj+XYkES1e+1tLNA4uS8pXHGvO51uZQ7J1GXL9zQWNI=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=pbq7IjvwDLAMoVk0ojoOAW0ve6SfH6BcdibLb6lyll0bH4fhFfXArmhNygFVmn93F XlN9eNJB66c/aGGewAFNkRAq4LYYuSt6sKD/2xguO1VJFth+xTzhB/3KKvFMplmI63 sVgIG7aL5mVxxnC0qU4A4OtP6aldLiIbg6+hSzdw= 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 1E5473858299 for ; Tue, 4 Oct 2022 17:08:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1E5473858299 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-310-X_3gI6GdODO-D0ZXemzLcQ-1; Tue, 04 Oct 2022 13:08:16 -0400 X-MC-Unique: X_3gI6GdODO-D0ZXemzLcQ-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3DD7C85A59D for ; Tue, 4 Oct 2022 17:08:16 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.40.192.57]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 601B6492B04; Tue, 4 Oct 2022 17:08:15 +0000 (UTC) To: gdb-patches@sourceware.org Subject: [PATCH 08/11] gdb/testsuite: disable gdb.cp/typeid.exp when using clang Date: Tue, 4 Oct 2022 19:07:44 +0200 Message-Id: <20221004170747.154307-10-blarsen@redhat.com> In-Reply-To: <20221004170747.154307-1-blarsen@redhat.com> References: <20221004170747.154307-1-blarsen@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.1 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, 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 from standard libraries, gdb.cp/typeid.exp will always fail, so this test is skipped when it clang used. --- gdb/testsuite/gdb.cp/typeid.exp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gdb/testsuite/gdb.cp/typeid.exp b/gdb/testsuite/gdb.cp/typeid.exp index 6411217191a..d110b3e7695 100644 --- a/gdb/testsuite/gdb.cp/typeid.exp +++ b/gdb/testsuite/gdb.cp/typeid.exp @@ -23,6 +23,11 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} { return -1 } +if {[test_compiler_info clang-*-*]} { + untested "clang does not add debuginfo for standard libraries" + return +} + proc do_typeid_tests {started} { global hex From patchwork Tue Oct 4 17:07:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guinevere Larsen X-Patchwork-Id: 58359 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 205893851422 for ; Tue, 4 Oct 2022 17:10:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 205893851422 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1664903411; bh=qCqGy1qk6a8NlM2Lia6vv2I0Ro3ZxyY0motmacGZd8g=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=dHQGUpTT2535ViHXXIg1ZS/avMy+aQaa5m1iERbJ8kbtY45eyi5q4hOw3h/PtlpJ7 BEtwbre80FbHM28l0MatFiIB6v3JpX8e+f0NE7pdXqRdbsKaHRmnwlXk7eIXQ1oUOe g64f6PVRbXaYGPY3+BUdlYbL5AJtC8Kr2LnQIva8= 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 BEA4E3857C41 for ; Tue, 4 Oct 2022 17:08:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BEA4E3857C41 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-582-hNPcmE6aM7WSpw5cguPdLA-1; Tue, 04 Oct 2022 13:08:18 -0400 X-MC-Unique: hNPcmE6aM7WSpw5cguPdLA-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1E524185A7A3 for ; Tue, 4 Oct 2022 17:08:18 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.40.192.57]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CA022492B04; Tue, 4 Oct 2022 17:08:16 +0000 (UTC) To: gdb-patches@sourceware.org Subject: [PATCH 09/11] gdb/testsuite: fix gdb.cp/converts.exp to run with clang Date: Tue, 4 Oct 2022 19:07:45 +0200 Message-Id: <20221004170747.154307-11-blarsen@redhat.com> In-Reply-To: <20221004170747.154307-1-blarsen@redhat.com> References: <20221004170747.154307-1-blarsen@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.1 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, 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" Clang attempts to minimize the size of the debug-info by not adding complete information about types that aren't constructed in a given file. In specific, this meant that there was minimal information about class B in the test gdb.cp/converts.exp. To fix this, we just need to construct any object of type B in that file. --- gdb/testsuite/gdb.cp/converts.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdb/testsuite/gdb.cp/converts.cc b/gdb/testsuite/gdb.cp/converts.cc index ecf806481fd..1224581a879 100644 --- a/gdb/testsuite/gdb.cp/converts.cc +++ b/gdb/testsuite/gdb.cp/converts.cc @@ -55,7 +55,7 @@ int main() char av = 'a'; char *a = &av; // pointer to.. - B *bp; + B *bp = new B(); foo1_1 (a); // ..pointer foo1_2 (a); // ..array foo1_3 ((int*)a); // ..pointer of wrong type From patchwork Tue Oct 4 17:07:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guinevere Larsen X-Patchwork-Id: 58360 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 A58FC3852766 for ; Tue, 4 Oct 2022 17:10:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A58FC3852766 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1664903415; bh=AYM1jbOTYCGnJ8IsAStHu16f4q67mgLOHyO2Wz3WwuE=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=ErCVVKspTC5glCpVUB5cCpXuKqv3pAgjSG9bNeOYytV4qsasVSzUHewNicMkPZJwR 05HNAvZ1KVMCPfeZJ51RXskIq1LmRilafC6ASyekdmPrhEclevAkLeeyM65Z1bbG3U N/G+1SRFjdwfJ/ft3esXJmFxDKUCsqk9/bnhj/sc= 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 069E13857C40 for ; Tue, 4 Oct 2022 17:08:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 069E13857C40 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-657-8imvuTrqOPGZ1LmFwvaeWw-1; Tue, 04 Oct 2022 13:08:19 -0400 X-MC-Unique: 8imvuTrqOPGZ1LmFwvaeWw-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 37768101A528 for ; Tue, 4 Oct 2022 17:08:19 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.40.192.57]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8A957492B04; Tue, 4 Oct 2022 17:08:18 +0000 (UTC) To: gdb-patches@sourceware.org Subject: [PATCH 10/11] gdb/testsuite: remove XFAIL on gdb.cp/temargs.exp Date: Tue, 4 Oct 2022 19:07:46 +0200 Message-Id: <20221004170747.154307-12-blarsen@redhat.com> In-Reply-To: <20221004170747.154307-1-blarsen@redhat.com> References: <20221004170747.154307-1-blarsen@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.4 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_LOW, 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 are not using clang. --- 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..135cf316b90 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_clang [test_compiler_info clang-*-*] + 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_clang { 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_clang { setup_xfail gcc/49546 "*-*-*" } gdb_test "print F" { = \(void \(\*\)\(int\)\) 0x[0-9a-f]+ } \ "test value of F in k3_m" From patchwork Tue Oct 4 17:07:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guinevere Larsen X-Patchwork-Id: 58357 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 5F48338515C6 for ; Tue, 4 Oct 2022 17:09:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5F48338515C6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1664903387; bh=OeMs8BxjwuUDB82SIzSsa3RXbIMk0/OcrvR0FQUOryM=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=LVdZOe0Mi5zhyp+KUNujlfv+ezFRQW3q7b47dDIePpsDrMxqnnz3mTzRolMZCZc3z Fao9tQqUdWmhC+nNB7syMDPFQ4vjr8xwGHXY0NWOIhUFXy4oRO5BBkaYzjhI3BiQXy zfYaL6lYwNGYsJMyX/y/1G/qdElQckINmJbFmGxc= 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 31C283857B93 for ; Tue, 4 Oct 2022 17:08:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 31C283857B93 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-664-FKmNvVSRNuG2slqBKTcQSQ-1; Tue, 04 Oct 2022 13:08:20 -0400 X-MC-Unique: FKmNvVSRNuG2slqBKTcQSQ-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9A754918861 for ; Tue, 4 Oct 2022 17:08:20 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.40.192.57]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 90EC2492B04; Tue, 4 Oct 2022 17:08:19 +0000 (UTC) To: gdb-patches@sourceware.org Subject: [PATCH 11/11] gdb/testsuite: disable gdb.cp/call-method-register.exp with clang Date: Tue, 4 Oct 2022 19:07:47 +0200 Message-Id: <20221004170747.154307-13-blarsen@redhat.com> In-Reply-To: <20221004170747.154307-1-blarsen@redhat.com> References: <20221004170747.154307-1-blarsen@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.1 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, 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 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..71d1f61f59f 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 clang-*-*]} { + untested "clang does not place the class in the register" + return +} + proc test_call_register_class {} { global gdb_prompt