From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 60EA23858D35 for ; Fri, 8 Sep 2023 10:28:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 60EA23858D35 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 9262021A21 for ; Fri, 8 Sep 2023 10:28:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1694168888; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VReLtz/0CxYMQu4Yo8ZBzJe+2Tgi39+7zK9wvbHmHfg=; b=DQhkk7cWv8Wmqwf68Dnz5AFGZXdI1rJB7WGF2BZ2uE/LLDT27VdCRjmkVh5FPuNJIA6x9Y Kd5gwischXCJHAmh/53Qeg30kfArj3+U/MskKEeELbfWncbZXRCc1KSD6wi/L5CAwcCuym mh/SF0hxaM3AqwuYF7toZCB1P1zwUuo= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1694168888; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VReLtz/0CxYMQu4Yo8ZBzJe+2Tgi39+7zK9wvbHmHfg=; b=3vnxgM3pGXeHwqTCuPJGptjqhQ5sHn1+29ft5KoLohC0ERusaKfOg3rVcE4C9Q65nfDR/3 RrM1HKFxNlJROSAQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 80A4A131FD for ; Fri, 8 Sep 2023 10:28:08 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id mOZTHjj3+mTRdQAAMHmgww (envelope-from ) for ; Fri, 08 Sep 2023 10:28:08 +0000 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [pushed 4/4] [gdb/testsuite] Make gdb.dwarf2/dwzbuildid.exp more robust Date: Fri, 8 Sep 2023 12:28:06 +0200 Message-Id: <20230908102806.13015-4-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230908102806.13015-1-tdevries@suse.de> References: <20230908102806.13015-1-tdevries@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,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 List-Id: I ran test-case gdb.dwarf2/dwzbuildid.exp with target board cc-with-gdb-index, and noticed that compilation failure for one exec prohibited testing of all execs. Fix this by restructuring the test-case, such that we have: ... PASS: gdb.dwarf2/dwzbuildid.exp: testname=ok: set debug-file-directory PASS: gdb.dwarf2/dwzbuildid.exp: testname=ok: print the_int UNSUPPORTED: gdb.dwarf2/dwzbuildid.exp: testname=mismatch: compilation failed UNSUPPORTED: gdb.dwarf2/dwzbuildid.exp: testname=fallback: compilation failed ... Tested on x86_64-linux. --- gdb/testsuite/gdb.dwarf2/dwzbuildid.exp | 70 ++++++++++++------------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/gdb/testsuite/gdb.dwarf2/dwzbuildid.exp b/gdb/testsuite/gdb.dwarf2/dwzbuildid.exp index 81cefc60dfc..76e3a7d6e42 100644 --- a/gdb/testsuite/gdb.dwarf2/dwzbuildid.exp +++ b/gdb/testsuite/gdb.dwarf2/dwzbuildid.exp @@ -134,46 +134,46 @@ for {set i 2} {$i <= 8} {incr i} { # Copy a file into the .build-id place for the "fallback" test. file copy -force -- ${binfile}8.o $basedir/$ok_prefix/$ok_suffix2.debug -# Link the executables. -if {[gdb_compile [list ${binfile}1.o ${binfile}2.o] ${binfile}-ok \ - executable {}] != ""} { - return -1 -} - -if {[gdb_compile [list ${binfile}1.o ${binfile}4.o] ${binfile}-mismatch \ - executable {quiet}] != ""} { - return -1 -} +proc do_test {} { + clean_restart -if {[gdb_compile [list ${binfile}1.o ${binfile}6.o] ${binfile}-fallback \ - executable {}] != ""} { - return -1 -} + gdb_test_no_output "set debug-file-directory $::debugdir" \ + "set debug-file-directory" + gdb_load ${::binfile}-${::testname} -foreach testname {ok mismatch fallback} { - with_test_prefix $testname { - clean_restart + if { $::testname == "mismatch" && [readnow] } { + # Main is found in the minimal symbols. When using readnow, a + # failure to read the dwarf also causes the minimal symbols to be + # unavailable. + # Setup a kfail for "FAIL: gdb_breakpoint: set breakpoint at main". + setup_kfail "symtab/26797" *-*-* + } + if {![runto_main]} { + return + } - gdb_test_no_output "set debug-file-directory $debugdir" \ - "set debug-file-directory" + if {$::testname == "mismatch"} { + gdb_test "print the_int" \ + "(No symbol table is loaded|No symbol \"the_int\" in current context).*" + } else { + gdb_test "print the_int" " = 99" + } +} - gdb_load ${binfile}-${testname} +foreach_with_prefix testname { ok mismatch fallback } { + if { $testname == "ok" } { + set objs [list ${binfile}1.o ${binfile}2.o] + } elseif { $testname == "mismatch" } { + set objs [list ${binfile}1.o ${binfile}4.o] + } elseif { $testname == "fallback" } { + set objs [list ${binfile}1.o ${binfile}6.o] + } - if { $testname == "mismatch" && [readnow] } { - # Main is found in the minimal symbols. When using readnow, a - # failure to read the dwarf also causes the minimal symbols to be - # unavailable. - # Setup a kfail for "FAIL: gdb_breakpoint: set breakpoint at main". - setup_kfail "symtab/26797" *-*-* - } - if {[runto_main]} { - if {$testname == "mismatch"} { - gdb_test "print the_int" \ - "(No symbol table is loaded|No symbol \"the_int\" in current context).*" - } else { - gdb_test "print the_int" " = 99" - } - } + if {[gdb_compile $objs ${binfile}-$testname executable {quiet}] != ""} { + unsupported "compilation failed" + continue } + + do_test } -- 2.35.3