From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 0XDfDOhYYWm1fTcAWB0awg (envelope-from ) for ; Fri, 09 Jan 2026 14:37:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1767987432; bh=mNpPVVIp0c61ZoUhn7m+xOU1A0hsCXB5VkCBEOy0hl8=; h=Date:Subject:To:Cc:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=eejRry5X1ZAvx2/cDEW1cjrTZryV77kttpYfhMmXf4sB9kjr7HwV1oS+RiivPhvFM ZNAAe7f+b73dyhIJwjI6L9CNX2M86rjcmXrG7PEDgAl+nzw1PJCpRXK3bxZpCFBJLP 52t0rgPAXvoRTtxmzTKK/NZawj0GVYK5zCrDGU4A= Received: by simark.ca (Postfix, from userid 112) id 2E38B1E0B6; Fri, 09 Jan 2026 14:37:12 -0500 (EST) 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 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=oovtsyME; dkim-atps=neutral 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 AD0EA1E08D for ; Fri, 09 Jan 2026 14:37:11 -0500 (EST) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id 4A2424BA2E28 for ; Fri, 9 Jan 2026 19:37:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4A2424BA2E28 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=oovtsyME Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 024964BA2E04 for ; Fri, 9 Jan 2026 19:36:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 024964BA2E04 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark.ca ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 024964BA2E04 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=158.69.221.121 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1767987401; cv=none; b=gFC/E7RwSCgKGpGPGXVDv3nsfLS2rDYuyyqpaZNL4pd5q8X9/hOPtGPzAWycMdY628iV/pGfJJRfX1YZurMnTieCGVExmGxvLE9eUkpr1VBItwCudnfF1xr0wUQvpNgZFuIpZKOmmKmgft6omqWmV+zyU83zXpyy+YpiGWnYUJc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1767987401; c=relaxed/simple; bh=mNpPVVIp0c61ZoUhn7m+xOU1A0hsCXB5VkCBEOy0hl8=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=oJDlwNzNtpYbcuKlnGNgLq+GZNffk5fTKhy5HXnkvGFIwbptxvJMFVh+L8xsNTsXZR31SriTJaeU8UNYbzHmUTchYIV5gbzm+0wuX+k9jjosH/LpJ+VWqCXqNd+3JjEMc5KedzG+9H9xwnpgAx5sRmqOD50M50jZvUuRInfrJ+c= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 024964BA2E04 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1767987400; bh=mNpPVVIp0c61ZoUhn7m+xOU1A0hsCXB5VkCBEOy0hl8=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=oovtsyMEp39Jqjj/IzFAX4vKsAYUXv/Q5DcuJVWSiGzTQsAxCiLUQRP7+dOFLVH2e Wbd4CyALhlAdAxawM8pqOUAIztwBi9Oto4ytJNLyTgPmY6kxviMVySeJHE8yiUl+08 7jqClWw4ervZFHRz4wmvE//WvpHD5G25wSl8Gtyk= Received: by simark.ca (Postfix) id 0A1E21E08D; Fri, 09 Jan 2026 14:36:39 -0500 (EST) Message-ID: <94f7f8f2-8e79-414e-98e6-8bd7e8ce6d2f@simark.ca> Date: Fri, 9 Jan 2026 14:36:39 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 3/3] gdb/coffread: simplify stab section detection To: Tom Tromey , Simon Marchi Cc: gdb-patches@sourceware.org References: <20260109191441.486109-1-simon.marchi@efficios.com> <20260109191441.486109-3-simon.marchi@efficios.com> <87ikdalh4a.fsf@tromey.com> Content-Language: fr From: Simon Marchi In-Reply-To: <87ikdalh4a.fsf@tromey.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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 On 1/9/26 2:29 PM, Tom Tromey wrote: >>>>>> "Simon" == Simon Marchi writes: > > Simon> We look for stab sections for the sole purpose of emitting a warning if > Simon> we see one. Simplify this by using a boolean to indicate if we saw a > Simon> stab section or not. Simplify the search to just look for sections > Simon> starting with ".stab", it should be enough for this purpose. > > Simon> Also, remove the make_scoped_restore that would overwrite the stab > Simon> section vector, I'm not sure why it's there. It seems to me like it > Simon> would cause the warning to never be shown. > > Simon> @@ -47,7 +47,8 @@ struct coff_symfile_info > Simon> file_ptr min_lineno_offset = 0; /* Where in file lowest line#s are. */ > Simon> file_ptr max_lineno_offset = 0; /* 1+last byte of line#s in file. */ > > Simon> - std::vector *stabsects; /* .stab sections. */ > Simon> + /* True if the symfile contains one section that starts with ".stab". */ > Simon> + bool found_stab_section = false; > > There's not really a reason to keep this in coff_symfile_info. That > said it hardly hurts and this is definitely an improvement regardless. > > Simon> if (!(objfile->flags & OBJF_READNEVER)) > Simon> bfd_map_over_sections (abfd, coff_locate_sections, (void *) info); > > ... I'd imagine it's a workaround for mapping over sections like this > rather than just using foreach. The latter makes it easier to do random > checks. > > Approved-By: Tom Tromey > > Tom You're right, I'll simplify this further. I have pushed the first two patches. Simon