From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id m2wFBB8S12p36TgAWB0awg (envelope-from ) for ; Tue, 20 Oct 2026 03:02:55 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=BnhCGNPy; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=vGbinr5+; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=cCQWNxDj; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=ECzEXUJq; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 877B11E050; Tue, 20 Oct 2026 03:02:54 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 703891E047 for ; Tue, 20 Oct 2026 03:02:48 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5715A4B99F43 for ; Tue, 20 Oct 2026 07:02:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5715A4B99F43 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=BnhCGNPy; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=vGbinr5+; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=cCQWNxDj; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=ECzEXUJq Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) by sourceware.org (Postfix) with ESMTPS id C3FD94BB1C26 for ; Tue, 20 Oct 2026 07:02:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C3FD94BB1C26 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org C3FD94BB1C26 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=195.135.223.130 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1792479721; cv=none; b=Q/vX7zAEuga0QAnGe4Cph3wN5ZxkPhqo00RGJtjOtw8WuuvgfmXflthNxx/V6IPXR6XvZXJOyl71vtEp3ANbQnjGb/E5VkOcm6BkvsY2kYmQbHYMsgLfJpjL80dhe44wiY09jAb8sTzjFjJHhn9PfUDti1O6q9geGpnfB/rLaO8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1792479721; c=relaxed/simple; bh=0cvuwSxDIH66FCm3xpMdvblivJjKV9b5Z3cg/B7X3jI=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:From: To:Subject:Date:Message-ID:MIME-Version; b=CWAk7Cu5GdGkxhnP/2RhQdR7RtCnylqHf2Y8prjFnWYatMAIZkga1KtpWZIXrkmM3gm/gtqUTBaPjciKMVaRk8EHdAXUol5gthOC3t2WsdEPfb4RfvqSYoSg/nAP8CoXzWFk5++tJT/zHGprjpc3k0EfdDnF+cpGonCPZW6MkSs= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=BnhCGNPy; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=vGbinr5+; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=cCQWNxDj; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=ECzEXUJq DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C3FD94BB1C26 Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 7CAC621DB6 for ; Tue, 20 Oct 2026 07:01:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1792479720; 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=08rM3SEnr6oSypW1bnIU4HCKcKPAEvMLi+cFqs9fbaM=; b=BnhCGNPyO2ygrPGPjb+uNufqOnKxOmR4uS4lZ/LUwJZE1ZssmutGiv6A4aHuf3pNJv6Q7j oj0Pa7C413xJ1GYYT9bdzOid4w1QsW0crKDfvH4GAmsdlH/Yr/nk7QjqiH8GXe0Ll2dyyW q2yMc6jio2vfUisf6ozkXlmESd7N6WM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1792479720; 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=08rM3SEnr6oSypW1bnIU4HCKcKPAEvMLi+cFqs9fbaM=; b=vGbinr5+chu3og/7evYdhCc8e0SlO7TGlizEUj3T52djcHW4ttoh/FXDQy0HRTVDNZGsco cODy9uMhjeoXfsCQ== Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=cCQWNxDj; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=ECzEXUJq DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1792479718; 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=08rM3SEnr6oSypW1bnIU4HCKcKPAEvMLi+cFqs9fbaM=; b=cCQWNxDjRzysCIeBJrQGo0+F4TpQAGiHqTE9ZSsculjZUsqBAlxABwT8PFYmY4H+zZOx0E QsAIK8B85QqJ+CExmyVaU+4rAVJg/0HKQlz1NSnL9TRMy/+nVEqSs/z3it1hHKUXCbz6KC IxdEHt54MIrLflv5ceSqDiohpodAI8U= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1792479718; 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=08rM3SEnr6oSypW1bnIU4HCKcKPAEvMLi+cFqs9fbaM=; b=ECzEXUJqKsrdWc7QyJ7VxrbKr3ukH5ZIuqF/YQzyN81A9nByx2TCVcp8HGtyk+QDz6VgVc sZQSOhtZAQozhrBQ== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 4B833137DB for ; Tue, 20 Oct 2026 07:01:58 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id 8IYQA+YR12oDYgAAD6G6ig:T2 (envelope-from ) for ; Tue, 20 Oct 2026 07:01:58 +0000 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [pushed 1/3] [gdb/testsuite] Factor out have_gnu_debuglink Date: Tue, 20 Oct 2026 09:01:55 +0200 Message-ID: <20261020070157.2414518-2-tdevries@suse.de> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20261020070157.2414518-1-tdevries@suse.de> References: <20261020070157.2414518-1-tdevries@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Action: no action X-Spamd-Result: default: False [-3.01 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; R_MISSING_CHARSET(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; RCVD_COUNT_TWO(0.00)[2]; ARC_NA(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; FROM_HAS_DN(0.00)[]; MIME_TRACE(0.00)[0:+]; FROM_EQ_ENVFROM(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns,suse.de:dkim]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_NONE(0.00)[]; RCVD_TLS_ALL(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[gdb-patches@sourceware.org]; DNSWL_BLOCKED(0.00)[2a07:de40:b281:106:10:150:64:167:received]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; DKIM_TRACE(0.00)[suse.de:+] X-Rspamd-Queue-Id: 7CAC621DB6 X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org Factor out proc have_gnu_debuglink, and use it, mostly via require. --- gdb/testsuite/gdb.base/dwz-symtabs.exp | 5 +---- gdb/testsuite/gdb.debuginfod/solib-with-dwz.exp | 5 +---- .../gdb.dwarf2/sig-type-unnamed-class-bad-sig.exp | 2 +- gdb/testsuite/gdb.tui/activate-from-secondary-prompt.exp | 7 ++----- gdb/testsuite/gdb.tui/debuginfod-query.exp | 5 +---- gdb/testsuite/lib/gdb.exp | 5 +++++ 6 files changed, 11 insertions(+), 18 deletions(-) diff --git a/gdb/testsuite/gdb.base/dwz-symtabs.exp b/gdb/testsuite/gdb.base/dwz-symtabs.exp index d695b272c9a..96fccc70df6 100644 --- a/gdb/testsuite/gdb.base/dwz-symtabs.exp +++ b/gdb/testsuite/gdb.base/dwz-symtabs.exp @@ -58,10 +58,7 @@ if {[build_executable "build libbar.so" $libbar_filename \ # adds a .gnu_debuglink, then this test isn't going to work. We want to be # in control of splitting out the debug information, and we definitely don't # want a .gnu_debuglink otherwise debuginfod isn't going to be needed. -if {[section_get $libbar_filename ".gnu_debuglink"] ne ""} { - unsupported "debug information has already been split out" - return -} +require {!have_gnu_debuglink $libbar_filename} # Compile libfoo.so. if {[build_executable "build libfoo.so" $libfoo_filename \ diff --git a/gdb/testsuite/gdb.debuginfod/solib-with-dwz.exp b/gdb/testsuite/gdb.debuginfod/solib-with-dwz.exp index 9808f6c3e87..caee4290c00 100644 --- a/gdb/testsuite/gdb.debuginfod/solib-with-dwz.exp +++ b/gdb/testsuite/gdb.debuginfod/solib-with-dwz.exp @@ -103,10 +103,7 @@ if {[build_executable "build libbar.so" $libbar_filename \ # adds a .gnu_debuglink, then this test isn't going to work. We want to be # in control of splitting out the debug information, and we definitely don't # want a .gnu_debuglink otherwise debuginfod isn't going to be needed. -if {[section_get $libbar_filename ".gnu_debuglink"] ne ""} { - unsupported "debug information has already been split out" - return -} +require {!have_gnu_debuglink $libbar_filename} # Compile libfoo.so. if {[build_executable "build libfoo.so" $libfoo_filename \ diff --git a/gdb/testsuite/gdb.dwarf2/sig-type-unnamed-class-bad-sig.exp b/gdb/testsuite/gdb.dwarf2/sig-type-unnamed-class-bad-sig.exp index 39a221a1b75..301a4325bc6 100644 --- a/gdb/testsuite/gdb.dwarf2/sig-type-unnamed-class-bad-sig.exp +++ b/gdb/testsuite/gdb.dwarf2/sig-type-unnamed-class-bad-sig.exp @@ -114,7 +114,7 @@ proc run_test { version } { # The path reported in the complaint message is always # absolute. Handle this with an optional prefix pattern. set binfile_re "\[^\r\n\]*[string_to_regexp $host_binfile]" - } elseif {[section_get $binfile_name ".gnu_debuglink"] ne ""} { + } elseif {[have_gnu_debuglink $binfile_name]} { set binfile_re "\[^\r\n\]+[string_to_regexp ${testfile_name}.debug]" } else { set binfile_re [string_to_regexp $binfile_name] diff --git a/gdb/testsuite/gdb.tui/activate-from-secondary-prompt.exp b/gdb/testsuite/gdb.tui/activate-from-secondary-prompt.exp index 3bfc7b1156d..9fcccec265c 100644 --- a/gdb/testsuite/gdb.tui/activate-from-secondary-prompt.exp +++ b/gdb/testsuite/gdb.tui/activate-from-secondary-prompt.exp @@ -129,6 +129,8 @@ proc_with_prefix test_from_debuginfod_prompt {} { return } + require {!have_gnu_debuglink $::binfile} + set stripped_binfile [standard_output_file ${::testfile}-stripped] file copy -force $::binfile $stripped_binfile if {[gdb_gnu_strip_debug $stripped_binfile no-debuglink]} { @@ -136,11 +138,6 @@ proc_with_prefix test_from_debuginfod_prompt {} { return } - if {[section_get $stripped_binfile ".gnu_debuglink"] ne ""} { - unsupported "debug information has already been split out" - return - } - save_vars { env(DEBUGINFOD_URLS) } { setenv DEBUGINFOD_URLS "foo" Term::clean_restart 24 80 diff --git a/gdb/testsuite/gdb.tui/debuginfod-query.exp b/gdb/testsuite/gdb.tui/debuginfod-query.exp index 98d61850842..1f46ca05299 100644 --- a/gdb/testsuite/gdb.tui/debuginfod-query.exp +++ b/gdb/testsuite/gdb.tui/debuginfod-query.exp @@ -29,10 +29,7 @@ if { [build_executable "build executable" $testfile $srcfile] == -1 } { return } -if {[section_get $binfile ".gnu_debuglink"] ne ""} { - unsupported "debug information has already been split out" - return -} +require {!have_gnu_debuglink $binfile} # Assume that GDB is in TUI mode, in the SRC layout, and that a # debuginfod prompt is currently active in the CMD window. diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index dba696cc130..1aae8cad1ae 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -12335,6 +12335,11 @@ proc section_get {exec section} { } } +# Return true if BINFILE has a .gnu_debuglink section. +proc have_gnu_debuglink {binfile} { + return [expr {[section_get $binfile ".gnu_debuglink"] ne ""}] +} + # Return true if we expect the build-id from FILENAME to be included # in a core file. # -- 2.51.0