From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id mbZtG2AKgWlLtSQAWB0awg (envelope-from ) for ; Mon, 02 Feb 2026 15:34:40 -0500 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=ApZwTPGC; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 698F31E08D; Mon, 02 Feb 2026 15:34:40 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,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 C18E01E08D for ; Mon, 02 Feb 2026 15:34:39 -0500 (EST) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id 3434F4BB58E6 for ; Mon, 2 Feb 2026 20:34:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3434F4BB58E6 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=ApZwTPGC Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTP id A262E4BA903E for ; Mon, 2 Feb 2026 20:34:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A262E4BA903E Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org A262E4BA903E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1770064453; cv=none; b=WGDZ7tlKjNZnnDOMmb2qNqlHEP78Pb1xOJjYfMDUO8ZRIEV/k5fC6G/Vg7QJJnL/egLrucB8NQBnmK1CakiHeCJMiKlHHoJr78K6xB1p9ioiYxE+BmOO7nuFpucU3vJCIk+4s8fPb+lBKAGbtyi2V1vCF+A8UfRkKluSAEE82i4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1770064453; c=relaxed/simple; bh=cVWsNvot1SV2FXWVDCTIDPSZCBRi8NHbec0f2g+8WYE=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=d3aUUFQzPrsgW+yCK9dYIuxksNz8v9wsg/w6YY/E4WWkz6WyXePjstJ37G42jAKqgdhzZU8wTPGv1SA57APbqui7LwqnH3Dlg404QWsuu2+DUwl6HkY1kCW+vc1VNiVkZNRYnMx80pR+pvd56QP1WzHj4Ajm6y8i93oNOjBUUWU= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A262E4BA903E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770064453; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YNSxjOT4140vIyEBXmRt3hjYpgHDvWV0VTpXlW9mg4M=; b=ApZwTPGCMz8zxS4RAhj3Z2Hpglkx+QuzYiKMV8l4/AszBSjWmlPq2B++DDhd+INrC+caHf qXfdHcBpYLqDd/VOlnE3K0g9zBjFtpUtI+k1DPINUQ6u8swpPCW2uX2XZmQGkspJGu1AJw 7q7Vz+Y3t7U82GcHKBPempk2QcB1O10= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-641-GI4jhBPqOYGSqq9Z-M6yyw-1; Mon, 02 Feb 2026 15:34:12 -0500 X-MC-Unique: GI4jhBPqOYGSqq9Z-M6yyw-1 X-Mimecast-MFC-AGG-ID: GI4jhBPqOYGSqq9Z-M6yyw_1770064451 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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 mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 540FB18003FC for ; Mon, 2 Feb 2026 20:34:11 +0000 (UTC) Received: from fedora.tailb97d54.ts.net (unknown [10.96.134.67]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 3032919560BA; Mon, 2 Feb 2026 20:34:09 +0000 (UTC) From: Guinevere Larsen To: gdb-patches@sourceware.org Cc: Guinevere Larsen Subject: [PATCH] gdb: fix filename matching in skiplist_entry::do_skip_gfile_p Date: Mon, 2 Feb 2026 17:34:04 -0300 Message-ID: <20260202203404.708144-1-guinevere@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: GevF5djG54JXi5F-DFfQWSYhIFmAADQ4oo3NAgmxq7o_1770064451 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit content-type: text/plain; charset="US-ASCII"; x-default=true 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 GDB is incorrectly matching -gfile skip entries. This is a regression introduced by the following commit: commit 02646a4c561ec88491114b87950cbb827c7d614c Author: Fangrui Song Date: Sun Dec 29 14:57:44 2024 -0800 skip -gfile: call fnmatch without FNM_FILE_NAME The author made the reasonable, but unfortunately incorrect, assumption that glibc's fnmatch, and consequently gdb_filename_fnmatch, will return the integer equivalent of a boolean (that is, 0 if the filenames do *not* match, non-zero if they match), but that is incorrect. This made it so using `skip -gfile` would skip all functions except the ones that are meant to be skipped. This commit fixes that inverted logic. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33872 --- gdb/skip.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gdb/skip.c b/gdb/skip.c index 1255c7d2152..ba2f22058ec 100644 --- a/gdb/skip.c +++ b/gdb/skip.c @@ -548,7 +548,8 @@ skiplist_entry::do_skip_gfile_p (const symtab_and_line &function_sal) const /* Note: symtab_to_fullname caches its result, thus we don't have to. */ const char *fullname = symtab_to_fullname (function_sal.symtab); - result = gdb_filename_fnmatch (m_file.c_str (), fullname, FNM_NOESCAPE); + result = gdb_filename_fnmatch (m_file.c_str (), fullname, FNM_NOESCAPE) + == 0; } if (debug_skip) base-commit: a6d46a04ea3e165c0ce2f11cd9d68bdcb81f4e4e -- 2.52.0