From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id EBzmFQgfbGALRgAAWB0awg (envelope-from ) for ; Tue, 06 Apr 2021 04:42:48 -0400 Received: by simark.ca (Postfix, from userid 112) id 57E431E939; Tue, 6 Apr 2021 04:42:48 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 861E51E590 for ; Tue, 6 Apr 2021 04:42:47 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DC16E384C003; Tue, 6 Apr 2021 08:42:46 +0000 (GMT) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by sourceware.org (Postfix) with ESMTPS id 5F0A13858034 for ; Tue, 6 Apr 2021 08:42:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 5F0A13858034 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tdevries@suse.de X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 83CB5AE06 for ; Tue, 6 Apr 2021 08:42:42 +0000 (UTC) Date: Tue, 6 Apr 2021 10:42:41 +0200 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [committed][gdb/testsuite] Fix xfail handling in gdb.threads/gcore-thread.exp Message-ID: <20210406084239.GA14782@delia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) 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: , Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" Hi, When running test-case gdb.threads/gcore-thread.exp on openSUSE Tumbleweed, I run into these XFAILs: ... XFAIL: gdb.threads/gcore-thread.exp: clear __stack_user.next XFAIL: gdb.threads/gcore-thread.exp: clear stack_used.next ... Apart from the xfail, the test-case also sets core0file to "": ... -re "No symbol \"${symbol}\" in current context\\.\r\n$gdb_prompt $" { xfail $test # Do not do the verification. set core0file "" } ... After which we run into this FAIL, because gdb_core_cmd fails to load a core file called "": ... (gdb) core ^M No core file now.^M (gdb) FAIL: gdb.threads/gcore-thread.exp: core0file: \ re-load generated corefile ... Fix this FAIL by skipping gdb_core_cmd if the core file is "". Tested on x86_64-linux. Committed to trunk. Thanks, - Tom [gdb/testsuite] Fix xfail handling in gdb.threads/gcore-thread.exp gdb/testsuite/ChangeLog: 2021-04-06 Tom de Vries PR testsuite/27691 * gdb.threads/gcore-thread.exp: Don't call gdb_core_cmd with core file "". --- gdb/testsuite/gdb.threads/gcore-thread.exp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/gdb/testsuite/gdb.threads/gcore-thread.exp b/gdb/testsuite/gdb.threads/gcore-thread.exp index 2a6ab172849..35c75f7a499 100644 --- a/gdb/testsuite/gdb.threads/gcore-thread.exp +++ b/gdb/testsuite/gdb.threads/gcore-thread.exp @@ -114,11 +114,13 @@ if {"$core0file" != ""} { # Now restart gdb and load the corefile. clean_restart ${testfile} -foreach name { corefile core0file } { with_test_prefix $name { - set core_loaded [gdb_core_cmd [subst $$name] "re-load generated corefile"] +proc load_core { filename } { + global horiz nl + + set core_loaded [gdb_core_cmd $filename "re-load generated corefile"] if { $core_loaded == -1 } { # No use proceeding from here. - continue + return } # FIXME: now what can we test about the thread state? @@ -139,4 +141,14 @@ foreach name { corefile core0file } { with_test_prefix $name { gdb_test "info threads" "\\* ${horiz} thread2 .*${nl}" \ "thread2 is current thread in corefile" -}} +} + +foreach name { corefile core0file } { + set filename [subst $$name] + if { $filename == "" } { + continue + } + with_test_prefix $name { + load_core $filename + } +}