From patchwork Wed Nov 30 19:35:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 61279 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 A2C51385457E for ; Wed, 30 Nov 2022 19:36:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A2C51385457E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1669836998; bh=voxBnT6h4RrRVkGit9J6L3BDDAb3YHlWowR6qCZQHTU=; 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=VmpS0znQz9u6H2SAgw3WQ+gbwOH5uZ3LHlW0t3PDQHQnkDMYseQseeRNgNPpDX4b5 auEL47b7nou2jYdz+4W21LCsL184kCsmyM/l5oySSCR/uY3hyayVy6LeISuIRT9mlU XKodvm/W+QgVqOo2QopZPzSuqKVQqvuAvQ0OwUX8= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mail-io1-xd34.google.com (mail-io1-xd34.google.com [IPv6:2607:f8b0:4864:20::d34]) by sourceware.org (Postfix) with ESMTPS id F2D243858434 for ; Wed, 30 Nov 2022 19:35:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org F2D243858434 Received: by mail-io1-xd34.google.com with SMTP id y6so13023316iof.9 for ; Wed, 30 Nov 2022 11:35:42 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=voxBnT6h4RrRVkGit9J6L3BDDAb3YHlWowR6qCZQHTU=; b=jX7r7zzNzHkdN1miksuZPBFrDUcoQRc976telsKNL7pPxLL+ZKZZEvFjU7cM8G3aec gF8376EC8oCaYkoJeTbyOT4brG1bHcQZ7FGThEpMVafXkw1eRZWECHPw20PNmds0tZ06 qGvnECrAyMgfVs9EpuY+a7BcOvTu2CUpBgf4FoCeiPrKeCx4hRiLQk//v+4peKrGiK1T 4BrUctvJChRPnGrpP+pH4VlhUAzBpATTGtJTQakeTcSFW8pPfx6qaUNUg9EnXAO6tNhL pXz/Ae0X8GRAcX3E9PpI9MrSGrdQngl2cdIOriMAPvR1+MKyOdOxf+gywIxMvrE0XNxS ITWA== X-Gm-Message-State: ANoB5pnrpU2QEj9Pbcd+ixWk2dJ4bckMIFEnRCzOVrcXUeguPT79hG2s vOiJzjNGCzvYeF7Un+bQBs5rO/TXELCEig== X-Google-Smtp-Source: AA0mqf789VtOcQdjrMf7LoOY3hTLRTlQW3wmmWgKzPRW1oSNRVsORe9WPtFXhYEOpcK0dZwoI9HiHw== X-Received: by 2002:a05:6638:345:b0:363:a7e9:194b with SMTP id x5-20020a056638034500b00363a7e9194bmr21873799jap.122.1669836941329; Wed, 30 Nov 2022 11:35:41 -0800 (PST) Received: from localhost.localdomain (97-122-76-186.hlrn.qwest.net. [97.122.76.186]) by smtp.gmail.com with ESMTPSA id o1-20020a027401000000b00375126ae55fsm857201jac.58.2022.11.30.11.35.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Nov 2022 11:35:40 -0800 (PST) To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 1/3] Remove one copy of skip_compile_feature_tests Date: Wed, 30 Nov 2022 12:35:29 -0700 Message-Id: <20221130193531.2464972-2-tromey@adacore.com> X-Mailer: git-send-email 2.34.3 In-Reply-To: <20221130193531.2464972-1-tromey@adacore.com> References: <20221130193531.2464972-1-tromey@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-11.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, 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: Tom Tromey via Gdb-patches From: Tom Tromey Reply-To: Tom Tromey Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" I noticed that there are two identical copies of skip_compile_feature_tests in the test suite. This removes one from gdb.exp, in favor of the one in compile-support.exp. --- gdb/testsuite/gdb.base/options.exp | 1 + gdb/testsuite/gdb.compile/compile-ifunc.exp | 2 ++ gdb/testsuite/gdb.compile/compile-ops.exp | 1 + gdb/testsuite/gdb.compile/compile-print.exp | 2 ++ gdb/testsuite/gdb.compile/compile-setjmp.exp | 2 ++ gdb/testsuite/gdb.compile/compile-tls.exp | 2 ++ gdb/testsuite/gdb.compile/compile.exp | 2 ++ gdb/testsuite/lib/gdb.exp | 20 -------------------- 8 files changed, 12 insertions(+), 20 deletions(-) diff --git a/gdb/testsuite/gdb.base/options.exp b/gdb/testsuite/gdb.base/options.exp index d10e7f8d66f..8fd968de1ad 100644 --- a/gdb/testsuite/gdb.base/options.exp +++ b/gdb/testsuite/gdb.base/options.exp @@ -31,6 +31,7 @@ # - thread apply # - taas +load_lib compile-support.exp load_lib completion-support.exp standard_testfile .c diff --git a/gdb/testsuite/gdb.compile/compile-ifunc.exp b/gdb/testsuite/gdb.compile/compile-ifunc.exp index 4f671c6453f..07de52c3f67 100644 --- a/gdb/testsuite/gdb.compile/compile-ifunc.exp +++ b/gdb/testsuite/gdb.compile/compile-ifunc.exp @@ -13,6 +13,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +load_lib compile-support.exp + if {[skip_ifunc_tests]} { return 0 } diff --git a/gdb/testsuite/gdb.compile/compile-ops.exp b/gdb/testsuite/gdb.compile/compile-ops.exp index 76f284f52f3..cff2f946c93 100644 --- a/gdb/testsuite/gdb.compile/compile-ops.exp +++ b/gdb/testsuite/gdb.compile/compile-ops.exp @@ -16,6 +16,7 @@ # Some coverage testing of DWARF operators for the compiler # integration. +load_lib compile-support.exp load_lib dwarf.exp # This test can only be run on targets which support DWARF-2 and use gas. diff --git a/gdb/testsuite/gdb.compile/compile-print.exp b/gdb/testsuite/gdb.compile/compile-print.exp index 051cfabe3ea..5d01c1a53d0 100644 --- a/gdb/testsuite/gdb.compile/compile-print.exp +++ b/gdb/testsuite/gdb.compile/compile-print.exp @@ -13,6 +13,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +load_lib compile-support.exp + standard_testfile if { [prepare_for_testing "failed to prepare" "$testfile"] } { diff --git a/gdb/testsuite/gdb.compile/compile-setjmp.exp b/gdb/testsuite/gdb.compile/compile-setjmp.exp index 89a65fb0da1..c883b2bd570 100644 --- a/gdb/testsuite/gdb.compile/compile-setjmp.exp +++ b/gdb/testsuite/gdb.compile/compile-setjmp.exp @@ -13,6 +13,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +load_lib compile-support.exp + standard_testfile .c compile-setjmp-mod.c if { [prepare_for_testing "failed to prepare" $testfile] } { diff --git a/gdb/testsuite/gdb.compile/compile-tls.exp b/gdb/testsuite/gdb.compile/compile-tls.exp index f9c9ee5e2f7..beffe7fd5be 100644 --- a/gdb/testsuite/gdb.compile/compile-tls.exp +++ b/gdb/testsuite/gdb.compile/compile-tls.exp @@ -13,6 +13,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . */ +load_lib compile-support.exp + standard_testfile .c if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" \ diff --git a/gdb/testsuite/gdb.compile/compile.exp b/gdb/testsuite/gdb.compile/compile.exp index f2515586c39..c712070872a 100644 --- a/gdb/testsuite/gdb.compile/compile.exp +++ b/gdb/testsuite/gdb.compile/compile.exp @@ -13,6 +13,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +load_lib compile-support.exp + standard_testfile .c compile-shlib.c compile-constvar.S compile-nodebug.c set options {} diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 23e3cc0c2d4..5067e240507 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -4195,26 +4195,6 @@ proc skip_libstdcxx_probe_tests {} { return [skip_libstdcxx_probe_tests_prompt "$gdb_prompt $"] } -# Return 1 if we should skip tests of the "compile" feature. -# This must be invoked after the inferior has been started. - -proc skip_compile_feature_tests {} { - global gdb_prompt - - set result 0 - gdb_test_multiple "compile code -- ;" "check for working compile command" { - "Could not load libcc1.*\r\n$gdb_prompt $" { - set result 1 - } - -re "Command not supported on this host\\..*\r\n$gdb_prompt $" { - set result 1 - } - -re "\r\n$gdb_prompt $" { - } - } - return $result -} - # Helper for gdb_is_target_* procs. TARGET_NAME is the name of the target # we're looking for (used to build the test name). TARGET_STACK_REGEXP # is a regexp that will match the output of "maint print target-stack" if From patchwork Wed Nov 30 19:35:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 61277 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 96392385515F for ; Wed, 30 Nov 2022 19:36:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 96392385515F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1669836968; bh=G8FRgeDh0XGTjWWVBco00HLQXxyYJzQ/5N6F/Ce2TBg=; 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=tJaRXaQGZj4wT9ADEjgMzSx72GdoqcStwvCpejkKq6ssmhvOcm+es5pAMjxzWCqoT 816/m8qCL+HcJmI2A5fhf81dGao09EtmMi6te6V7AKul0lgd10LhuvLzcxQO1CceMH QS53M1wtblegVC8ORT1K2KMSUko768u3zaosEYww= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mail-il1-x12d.google.com (mail-il1-x12d.google.com [IPv6:2607:f8b0:4864:20::12d]) by sourceware.org (Postfix) with ESMTPS id B49E9385842E for ; Wed, 30 Nov 2022 19:35:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B49E9385842E Received: by mail-il1-x12d.google.com with SMTP id m15so8570895ilq.2 for ; Wed, 30 Nov 2022 11:35:42 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=G8FRgeDh0XGTjWWVBco00HLQXxyYJzQ/5N6F/Ce2TBg=; b=Rk4mAsKEWy+m7E+GjtfgnRa3tz3SjdAvi7OxfAj72mhScE4onVZ8TdqCH+JNZ5f4Cm Lx5eLlee0wrUu+z4Pj++JOzyUjIRx1JSg5O0yA7M6zGxP2A5SZSihlqLRSUEkGIk1n/w uGAhTAvD1D9BiO/5DQbjdGO/b7IJA9Em3i++BY96TjRDARne25qHnUs0Lxe9awz5REl1 Dyr8glz6Buxt1dlMgyVJ9RaYE34pGOhbUZBuDP63h7Z2FoqC69xFHxuHuVWJrOWtxY3A PCeVV0wLwMLRS9opBXF7KEbo1gsgx2wxfGTxewiS5V8jWNXAlkai5VQK5MTI2GflCJkb GjHQ== X-Gm-Message-State: ANoB5pkqVemAcKTQE64Oxq6e36PhXAZ82NYJMWCnKPoWoFaeibiwqkKF txZZ/xZwD6QhQo4nM/YcEF9caVb09/kKcw== X-Google-Smtp-Source: AA0mqf75NeokswcJL28ICKZMMR6O5n55ZwuLNK1yQBYsQLOsXeu13ngnXxwQ2RMn8JFstAKko16ebQ== X-Received: by 2002:a92:db4b:0:b0:302:5575:9e46 with SMTP id w11-20020a92db4b000000b0030255759e46mr28404208ilq.41.1669836941993; Wed, 30 Nov 2022 11:35:41 -0800 (PST) Received: from localhost.localdomain (97-122-76-186.hlrn.qwest.net. [97.122.76.186]) by smtp.gmail.com with ESMTPSA id o1-20020a027401000000b00375126ae55fsm857201jac.58.2022.11.30.11.35.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Nov 2022 11:35:41 -0800 (PST) To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 2/3] Remove obsolete check from skip_compile_feature_tests Date: Wed, 30 Nov 2022 12:35:30 -0700 Message-Id: <20221130193531.2464972-3-tromey@adacore.com> X-Mailer: git-send-email 2.34.3 In-Reply-To: <20221130193531.2464972-1-tromey@adacore.com> References: <20221130193531.2464972-1-tromey@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-11.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, 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: Tom Tromey via Gdb-patches From: Tom Tromey Reply-To: Tom Tromey Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" skip_compile_feature_tests checks for "Command not supported on this host", but this error was removed by commit e8d8cce6 ("Import mkdtemp gnulib module, fix mingw build"). This patch removes the obsolete test. --- gdb/testsuite/lib/compile-support.exp | 3 --- 1 file changed, 3 deletions(-) diff --git a/gdb/testsuite/lib/compile-support.exp b/gdb/testsuite/lib/compile-support.exp index 58b3e4e3a1e..16b7c5dbc0d 100644 --- a/gdb/testsuite/lib/compile-support.exp +++ b/gdb/testsuite/lib/compile-support.exp @@ -26,9 +26,6 @@ proc skip_compile_feature_tests {} { "Could not load libcc1.*\r\n$gdb_prompt $" { set result 1 } - -re "Command not supported on this host\\..*\r\n$gdb_prompt $" { - set result 1 - } -re "\r\n$gdb_prompt $" { } } From patchwork Wed Nov 30 19:35:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 61278 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 8D209385B51E for ; Wed, 30 Nov 2022 19:36:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8D209385B51E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1669836998; bh=nVHcpOvI3fHnY/UVPudAjkgprP8SDQxV9WBkWjCtS7M=; 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=Dm6Z0wkZBqlpIZTuwG2xVsUEoZN/WxeqNzBmCxmD7zlLRqFu79WxCUEHEnQ2ATZlI UVdKL7Ucb1gDyauWZL26qYGbf3d18ke5NMKBSQzCmS80gs1SZYra7p7/irgCR1PV5G q8JmesCE8iC915sQVDbWZpBJRISND2qnVTOKABG0= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mail-io1-xd2e.google.com (mail-io1-xd2e.google.com [IPv6:2607:f8b0:4864:20::d2e]) by sourceware.org (Postfix) with ESMTPS id 847FA3858D1E for ; Wed, 30 Nov 2022 19:35:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 847FA3858D1E Received: by mail-io1-xd2e.google.com with SMTP id n188so13010696iof.8 for ; Wed, 30 Nov 2022 11:35:43 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nVHcpOvI3fHnY/UVPudAjkgprP8SDQxV9WBkWjCtS7M=; b=EaZjMadP4owsHtdNiX0uHW1rFO5sKilpWxBSNQSS41pxXekThhtZKV7HJjxGJYnkY0 ux6X4jAevQLyx+ExCIgRAqwknE8xQgj0WCqCw24801IVAk305N9FWeLTXpU0FyaXU57M kq4AJijqteH5HQVe7dNbva6IaBsOuoSx57VPXWPWRayZp9HYhjpTMVmmZmr1ujCdxi0g uCbnd3tdkxkI2yp6QoDaKjkd0GMF1f6kLSVml+915eUmC55sYO1z4We58sNN0WXskk/H 17JnGPU7WX+3W+mxp5SBC27x3fA6TqgkFMwj6OLk9n7klZGLO8UGdjZqekxwExin9/bX 5g5Q== X-Gm-Message-State: ANoB5pmlNVcKbFukYEjkE/tiSJDbFiCGtOq2YQ2x+Oxl0tPzpPDhr1Hf /uhwUgxBeOCgjxOAPpUn/dlDg8y9dq11Cg== X-Google-Smtp-Source: AA0mqf7EYbjvWqzma1n9bp/IO0/1w989XqkNa2+XLSWOPlTnrl021hkRvqk1jSonc3oU8rs+NYiJ5A== X-Received: by 2002:a6b:e714:0:b0:6df:7332:70f0 with SMTP id b20-20020a6be714000000b006df733270f0mr10024506ioh.154.1669836942707; Wed, 30 Nov 2022 11:35:42 -0800 (PST) Received: from localhost.localdomain (97-122-76-186.hlrn.qwest.net. [97.122.76.186]) by smtp.gmail.com with ESMTPSA id o1-20020a027401000000b00375126ae55fsm857201jac.58.2022.11.30.11.35.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Nov 2022 11:35:42 -0800 (PST) To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 3/3] Avoid timeouts in gdb.compile Date: Wed, 30 Nov 2022 12:35:31 -0700 Message-Id: <20221130193531.2464972-4-tromey@adacore.com> X-Mailer: git-send-email 2.34.3 In-Reply-To: <20221130193531.2464972-1-tromey@adacore.com> References: <20221130193531.2464972-1-tromey@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-11.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, 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: Tom Tromey via Gdb-patches From: Tom Tromey Reply-To: Tom Tromey Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" PR compile/29541 points out that some of the C++ tests in gdb.compile will time out when the glibc debuginfo is installed. This was interfering with my hacking on gdb by making test runs extremely long, so I looked into it. Internally the bug seems to be that gdb tries to convert multiple symbols named "var" via the compiler interface; one such symbol (I didn't track it down too far) causes the C++ compiler plugin to crash. Unfortunately, the crash is reported as a timeout, as the gdb side of the plugin simply hangs. This seems like a bug in the plugin RPC mechanism and, worse, apparently when I wrote this stuff I didn't really consider error reporting very much at all, so gdb can't really detect failures in the first place. Anyway... this patch works around the timeout by compiling a simple test that should provoke this bug, and then using "untested" if it notices a GCC crash. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29541 --- .../gdb.compile/compile-cplus-anonymous.exp | 10 ++-- .../gdb.compile/compile-cplus-array-decay.exp | 4 +- .../gdb.compile/compile-cplus-inherit.exp | 10 ++-- .../gdb.compile/compile-cplus-member.exp | 10 ++-- .../gdb.compile/compile-cplus-method.exp | 10 ++-- .../gdb.compile/compile-cplus-namespace.exp | 10 ++-- .../gdb.compile/compile-cplus-nested.exp | 10 ++-- .../gdb.compile/compile-cplus-print.exp | 3 +- .../gdb.compile/compile-cplus-virtual.exp | 10 ++-- gdb/testsuite/gdb.compile/compile-cplus.exp | 9 ++-- gdb/testsuite/gdb.compile/compile-ifunc.exp | 3 +- gdb/testsuite/gdb.compile/compile-ops.exp | 3 +- gdb/testsuite/gdb.compile/compile-print.exp | 3 +- gdb/testsuite/gdb.compile/compile-setjmp.exp | 3 +- gdb/testsuite/gdb.compile/compile-tls.exp | 3 +- gdb/testsuite/gdb.compile/compile.exp | 3 +- gdb/testsuite/lib/compile-support.exp | 48 ++++++++++++++++--- 17 files changed, 82 insertions(+), 70 deletions(-) diff --git a/gdb/testsuite/gdb.compile/compile-cplus-anonymous.exp b/gdb/testsuite/gdb.compile/compile-cplus-anonymous.exp index 26a331a2ac8..c3ffeeb93fd 100644 --- a/gdb/testsuite/gdb.compile/compile-cplus-anonymous.exp +++ b/gdb/testsuite/gdb.compile/compile-cplus-anonymous.exp @@ -33,15 +33,13 @@ if {![runto_main]} { return -1 } -if {[skip_compile_feature_tests]} { - untested \ - "compile command not supported (could not find libcc1 shared library?)" - return -1 -} - gdb_breakpoint [gdb_get_line_number "break here" $srcfile] gdb_continue_to_breakpoint "testing location" +if {[skip_compile_feature_untested "var = 0"]} { + return -1 +} + # Reminder, "var" is an integer; all these types get converted to `int'. CompileExpression::new "var" CompileExpression::test "anon_e" {(3|GHI)} diff --git a/gdb/testsuite/gdb.compile/compile-cplus-array-decay.exp b/gdb/testsuite/gdb.compile/compile-cplus-array-decay.exp index 18062a31b9c..2892d2415be 100644 --- a/gdb/testsuite/gdb.compile/compile-cplus-array-decay.exp +++ b/gdb/testsuite/gdb.compile/compile-cplus-array-decay.exp @@ -33,9 +33,7 @@ if {![runto_main]} { return -1 } -if {[skip_compile_feature_tests]} { - untested \ - "compile command not supported (could not find libcc1 shared library?)" +if {[skip_compile_feature_untested]} { return -1 } diff --git a/gdb/testsuite/gdb.compile/compile-cplus-inherit.exp b/gdb/testsuite/gdb.compile/compile-cplus-inherit.exp index 8f3d282cd49..536a5a45fc2 100644 --- a/gdb/testsuite/gdb.compile/compile-cplus-inherit.exp +++ b/gdb/testsuite/gdb.compile/compile-cplus-inherit.exp @@ -33,15 +33,13 @@ if {![runto_main]} { return -1 } -if {[skip_compile_feature_tests]} { - untested \ - "compile command not supported (could not find libcc1 shared library?)" - return -1 -} - gdb_breakpoint [gdb_get_line_number "break here" $srcfile] gdb_continue_to_breakpoint "testing location" +if {[skip_compile_feature_untested "var = 0"]} { + return -1 +} + CompileExpression::new "var" CompileExpression::test "d.a_" 1 CompileExpression::test "d.b_" 2 diff --git a/gdb/testsuite/gdb.compile/compile-cplus-member.exp b/gdb/testsuite/gdb.compile/compile-cplus-member.exp index 9325863a3bb..c18f965c9f3 100644 --- a/gdb/testsuite/gdb.compile/compile-cplus-member.exp +++ b/gdb/testsuite/gdb.compile/compile-cplus-member.exp @@ -33,15 +33,13 @@ if {![runto_main]} { return -1 } -if {[skip_compile_feature_tests]} { - untested \ - "compile command not supported (could not find libcc1 shared library?)" - return -1 -} - gdb_breakpoint [gdb_get_line_number "break here" $srcfile] gdb_continue_to_breakpoint "testing location" +if {[skip_compile_feature_untested "var = 0"]} { + return -1 +} + CompileExpression::new "var" CompileExpression::test "a.public_" 1 CompileExpression::test "a.protected_" {(21|N::NB)} diff --git a/gdb/testsuite/gdb.compile/compile-cplus-method.exp b/gdb/testsuite/gdb.compile/compile-cplus-method.exp index 07e4a59bb36..2f96f5fb147 100644 --- a/gdb/testsuite/gdb.compile/compile-cplus-method.exp +++ b/gdb/testsuite/gdb.compile/compile-cplus-method.exp @@ -33,15 +33,13 @@ if {![runto_main]} { return -1 } -if {[skip_compile_feature_tests]} { - untested \ - "compile command not supported (could not find libcc1 shared library?)" - return -1 -} - gdb_breakpoint [gdb_get_line_number "break here" $srcfile] gdb_continue_to_breakpoint "testing location" +if {[skip_compile_feature_untested "var = 0"]} { + return -1 +} + CompileExpression::new "var" CompileExpression::test "a->get_var ()" 21 CompileExpression::test "a->get_var (static_cast (1))" 100 diff --git a/gdb/testsuite/gdb.compile/compile-cplus-namespace.exp b/gdb/testsuite/gdb.compile/compile-cplus-namespace.exp index 4fc626beb22..ec4d0099846 100644 --- a/gdb/testsuite/gdb.compile/compile-cplus-namespace.exp +++ b/gdb/testsuite/gdb.compile/compile-cplus-namespace.exp @@ -33,15 +33,13 @@ if {![runto_main]} { return -1 } -if {[skip_compile_feature_tests]} { - untested \ - "compile command not supported (could not find libcc1 shared library?)" - return -1 -} - gdb_breakpoint [gdb_get_line_number "break here" $srcfile] gdb_continue_to_breakpoint "testing location" +if {[skip_compile_feature_untested "var = 0"]} { + return -1 +} + CompileExpression::new "var" CompileExpression::test "N1::N2::N3::N4::n4static" 400 CompileExpression::test "N1::N2::N3::N4::S4::s4static" 40 diff --git a/gdb/testsuite/gdb.compile/compile-cplus-nested.exp b/gdb/testsuite/gdb.compile/compile-cplus-nested.exp index 1d28e3471cb..a5ad87e49f9 100644 --- a/gdb/testsuite/gdb.compile/compile-cplus-nested.exp +++ b/gdb/testsuite/gdb.compile/compile-cplus-nested.exp @@ -33,15 +33,13 @@ if {![runto_main]} { return -1 } -if {[skip_compile_feature_tests]} { - untested \ - "compile command not supported (could not find libcc1 shared library?)" - return -1 -} - gdb_breakpoint [gdb_get_line_number "break here" $srcfile] gdb_continue_to_breakpoint "testing location" +if {[skip_compile_feature_untested "var = 0"]} { + return -1 +} + CompileExpression::new "var" CompileExpression::test "i1.a_" 2 CompileExpression::test "i2.a_" 3 diff --git a/gdb/testsuite/gdb.compile/compile-cplus-print.exp b/gdb/testsuite/gdb.compile/compile-cplus-print.exp index 67b39518b74..38dd922d27e 100644 --- a/gdb/testsuite/gdb.compile/compile-cplus-print.exp +++ b/gdb/testsuite/gdb.compile/compile-cplus-print.exp @@ -36,8 +36,7 @@ if ![runto_main] { return -1 } -if {[skip_compile_feature_tests]} { - untested "compile command not supported (could not find libcc1 shared library?)" +if {[skip_compile_feature_untested]} { return -1 } diff --git a/gdb/testsuite/gdb.compile/compile-cplus-virtual.exp b/gdb/testsuite/gdb.compile/compile-cplus-virtual.exp index ee1a4d92e38..3ccd681ea46 100644 --- a/gdb/testsuite/gdb.compile/compile-cplus-virtual.exp +++ b/gdb/testsuite/gdb.compile/compile-cplus-virtual.exp @@ -33,15 +33,13 @@ if {![runto_main]} { return -1 } -if {[skip_compile_feature_tests]} { - untested \ - "compile command not supported (could not find libcc1 shared library?)" - return -1 -} - gdb_breakpoint [gdb_get_line_number "break here" $srcfile] gdb_continue_to_breakpoint "testing location" +if {[skip_compile_feature_untested "var = 0"]} { + return -1 +} + CompileExpression::new "var" CompileExpression::test "b.doit ()" 2 CompileExpression::test "c.doit ()" 3 diff --git a/gdb/testsuite/gdb.compile/compile-cplus.exp b/gdb/testsuite/gdb.compile/compile-cplus.exp index dbdae5f8bf4..10e70e4a8e6 100644 --- a/gdb/testsuite/gdb.compile/compile-cplus.exp +++ b/gdb/testsuite/gdb.compile/compile-cplus.exp @@ -52,8 +52,10 @@ if ![runto_main] { return -1 } -if {[skip_compile_feature_tests]} { - untested "compile command not supported (could not find libcc1 shared library?)" +gdb_breakpoint [gdb_get_line_number "break-here"] +gdb_continue_to_breakpoint "break-here" ".* break-here .*" + +if {[skip_compile_feature_untested "var = 0"]} { return -1 } @@ -132,9 +134,6 @@ gdb_test "compile code *(volatile int *) 0 = 0;" \ "The program being debugged was signaled while in a function called from GDB\\.\r\nGDB has restored the context to what it was before the call\\.\r\n.*" \ "compile code segfault second" -gdb_breakpoint [gdb_get_line_number "break-here"] -gdb_continue_to_breakpoint "break-here" ".* break-here .*" - # C++ Specific tests. ## Public methods and members diff --git a/gdb/testsuite/gdb.compile/compile-ifunc.exp b/gdb/testsuite/gdb.compile/compile-ifunc.exp index 07de52c3f67..5c51dd173c5 100644 --- a/gdb/testsuite/gdb.compile/compile-ifunc.exp +++ b/gdb/testsuite/gdb.compile/compile-ifunc.exp @@ -43,8 +43,7 @@ with_test_prefix "nodebug" { # feature check below will work. gdb_test_no_output "set language c" "" - if {[skip_compile_feature_tests]} { - untested "compile command not supported (could not find libcc1 shared library?)" + if {[skip_compile_feature_untested]} { return -1 } diff --git a/gdb/testsuite/gdb.compile/compile-ops.exp b/gdb/testsuite/gdb.compile/compile-ops.exp index cff2f946c93..e18f92eaa39 100644 --- a/gdb/testsuite/gdb.compile/compile-ops.exp +++ b/gdb/testsuite/gdb.compile/compile-ops.exp @@ -418,8 +418,7 @@ if ![runto func] { return -1 } -if {[skip_compile_feature_tests]} { - untested "compile command not supported (could not find libcc1 shared library?)" +if {[skip_compile_feature_untested]} { return -1 } diff --git a/gdb/testsuite/gdb.compile/compile-print.exp b/gdb/testsuite/gdb.compile/compile-print.exp index 5d01c1a53d0..61d13312e3a 100644 --- a/gdb/testsuite/gdb.compile/compile-print.exp +++ b/gdb/testsuite/gdb.compile/compile-print.exp @@ -25,8 +25,7 @@ if ![runto_main] { return -1 } -if {[skip_compile_feature_tests]} { - untested "compile command not supported (could not find libcc1 shared library?)" +if {[skip_compile_feature_untested]} { return -1 } diff --git a/gdb/testsuite/gdb.compile/compile-setjmp.exp b/gdb/testsuite/gdb.compile/compile-setjmp.exp index c883b2bd570..2f9d844c89b 100644 --- a/gdb/testsuite/gdb.compile/compile-setjmp.exp +++ b/gdb/testsuite/gdb.compile/compile-setjmp.exp @@ -25,8 +25,7 @@ if ![runto_main] { return -1 } -if {[skip_compile_feature_tests]} { - untested "compile command not supported (could not find libcc1 shared library?)" +if {[skip_compile_feature_untested]} { return -1 } diff --git a/gdb/testsuite/gdb.compile/compile-tls.exp b/gdb/testsuite/gdb.compile/compile-tls.exp index beffe7fd5be..6b349069ec7 100644 --- a/gdb/testsuite/gdb.compile/compile-tls.exp +++ b/gdb/testsuite/gdb.compile/compile-tls.exp @@ -27,8 +27,7 @@ if {![runto_main]} { return 0 } -if {[skip_compile_feature_tests]} { - untested "compile command not supported (could not find libcc1 shared library?)" +if {[skip_compile_feature_untested]} { return -1 } diff --git a/gdb/testsuite/gdb.compile/compile.exp b/gdb/testsuite/gdb.compile/compile.exp index c712070872a..b75ec4bd485 100644 --- a/gdb/testsuite/gdb.compile/compile.exp +++ b/gdb/testsuite/gdb.compile/compile.exp @@ -57,8 +57,7 @@ if ![runto_main] { return -1 } -if {[skip_compile_feature_tests]} { - untested "compile command not supported (could not find libcc1 shared library?)" +if {[skip_compile_feature_untested]} { return -1 } diff --git a/gdb/testsuite/lib/compile-support.exp b/gdb/testsuite/lib/compile-support.exp index 16b7c5dbc0d..b6427337c5b 100644 --- a/gdb/testsuite/lib/compile-support.exp +++ b/gdb/testsuite/lib/compile-support.exp @@ -15,16 +15,31 @@ # Generic/oft used support routines for testing GDB's compile feature. -# Return 1 if we should skip tests of the "compile" feature. -# This must be invoked after the inferior has been started. +# Helper function for skip_compile_feature_tests. This does the real +# work, but should not be called directly. Returns a failure reason +# (a string) on failure, or the empty string on success. -proc skip_compile_feature_tests {} { +proc _do_check_compile {expr} { global gdb_prompt - set result 0 - gdb_test_multiple "compile code -- ;" "check for working compile command" { + set result "" + gdb_test_multiple "compile code -- $expr;" "check for working compile command" { "Could not load libcc1.*\r\n$gdb_prompt $" { - set result 1 + set result "could not find libcc1" + } + "Could not load libcp1.*\r\n$gdb_prompt $" { + set result "could not find libcp1" + } + -re "WARNING .* there are active plugins, do not report this" { + # Note that the regexp above does not check for the + # prompt. This avoids a gratuitous timeout. + set result "GCC crashed" + } + -re "confused by earlier errors, bailing out" { + # This scenario can happen when either GCC or GDB is + # confused by some other debuginfo. + # See PR compile/29541. + set result "confused by glibc debuginfo" } -re "\r\n$gdb_prompt $" { } @@ -32,6 +47,27 @@ proc skip_compile_feature_tests {} { return $result } +# Return 1 if we should skip tests of the "compile" feature. +# This must be invoked after the inferior has been started. +# EXPR is the expression to test, if any (using the default empty EXPR +# works fine in most cases). + +proc skip_compile_feature_tests {{expr ""}} { + return [expr {[string length [_do_check_compile $expr]] > 0}] +} + +# Like skip_compile_feature_tests, but also issue an "untested" when +# skipping. + +proc skip_compile_feature_untested {{expr ""}} { + set output [_do_check_compile $expr] + if {[string length $output] > 0} { + untested "compile command not supported ($output)" + return 1 + } + return 0 +} + # This namespace provides some convenience functions for running # "compile code" and "compile print" tests. #