From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id RHRdFPhHpGq/AgEAWB0awg (envelope-from ) for ; Fri, 11 Sep 2026 14:27:04 -0400 Authentication-Results: simark.ca; dkim=fail reason="signature verification failed" (768-bit key; unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=iINW/agL; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 37C361E033; Fri, 11 Sep 2026 14:27:04 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_BL_SPAMCOP_NET, RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=no 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 B14F11E033 for ; Fri, 11 Sep 2026 14:27:03 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 120A24A9E045 for ; Fri, 11 Sep 2026 18:27:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 120A24A9E045 Authentication-Results: sourceware.org; dkim=fail reason="signature verification failed" (768-bit key, unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=iINW/agL Received: from omta36.uswest2.a.cloudfilter.net (omta36.uswest2.a.cloudfilter.net [35.89.44.35]) by sourceware.org (Postfix) with ESMTPS id 405A64BA23EF for ; Fri, 11 Sep 2026 18:26:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 405A64BA23EF Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 405A64BA23EF Authentication-Results: sourceware.org; arc=none smtp.remote-ip=35.89.44.35 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1789151199; cv=none; b=boZxKySP0hzNN/gMEuxvPAD9NJVdJYIqtHu99JwnFJgQHqLXQXRb9LUJOAT9/Jzn+YTnfZsCqdRxOH+nbPqoo4azMyGO5iKpS5839CZmSYC5aAvTIIDVX6F6qI075qtMly9u6kGgnjOLzuAzGvQjD1xXIHfsx4u922Tb1gN0ZTc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1789151199; c=relaxed/simple; bh=FxnmHXexEHuT6j2op5DiR+sPISjVM+6UPR1bzkDCwkg=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=Llhwp+m83ouw0K0vkm8UlAzoKu7qzrtzE3vgPsQyLlgqF1u6cIoQ/T4KpX4E1hD20FK7rC7MziM5WnGLRiJisqc7kyGGbgXjHQAfPHRbQyrPcH7zOeucq2JjfXKcjrh0Er/osE3SO3/Gxxu10RmMJRtMXjwcSO7BY/AHVeia1HQ= ARC-Authentication-Results: i=1; sourceware.org; dkim=policy (768-bit key, unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=iINW/agL reason="signing key too small" DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 405A64BA23EF Received: from eig-obgw-6004b.ext.cloudfilter.net ([10.0.30.210]) by cmsmtp with ESMTPS id 53olxjiowusRS55xOx2SB9; Fri, 11 Sep 2026 18:26:38 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id 55xNxGowPn6N555xNxz45L; Fri, 11 Sep 2026 18:26:38 +0000 X-Authority-Analysis: v=2.4 cv=LJJmQIW9 c=1 sm=1 tr=0 ts=6aa447de a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=VdqzKS8jKosA:10 a=ItBw4LHWJt0A:10 a=N-NT6lXfJxH1MlxfTqEA:9 a=DCx65vhANUyCzuf5D8fC:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:Date:References:In-Reply-To :Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Unsubscribe-Post: List-Subscribe:List-Post:List-Owner:List-Archive; bh=K4AUMpvM/hZYTHwjjBmHHOiDYouYHHfJGcelN9ro8e8=; b=iINW/agL43/rIfVovVf/pf+Grq UJU80AvTjf0Nc7m14lAaXXnKODvjVVJFpGxuOFyxqnReaWdBNYB3coxqniAos+yPcKDTjDVmO53lb gY1IOSaqAyEVcjmRAs5tMnyqb; Received: from 97-122-117-2.hlrn.qwest.net ([97.122.117.2]:57406 helo=bapiya) by box5379.bluehost.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.100) (envelope-from ) id 1x55xN-00000001lxl-11KM; Fri, 11 Sep 2026 12:26:37 -0600 From: Tom Tromey To: Tom de Vries Cc: gdb-patches@sourceware.org Subject: Re: [PATCH v2 3/7] [gdb/tui] Improve section handling in tui_find_backward_disassembly_start_address In-Reply-To: <20260909094849.2745086-4-tdevries@suse.de> (Tom de Vries's message of "Wed, 9 Sep 2026 11:48:45 +0200") References: <20260909094849.2745086-1-tdevries@suse.de> <20260909094849.2745086-4-tdevries@suse.de> X-Attribution: Tom Date: Fri, 11 Sep 2026 12:26:36 -0600 Message-ID: <87pkyjy78j.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 97.122.117.2 X-Source-L: No X-Exim-ID: 1x55xN-00000001lxl-11KM X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-122-117-2.hlrn.qwest.net (bapiya) [97.122.117.2]:57406 X-Source-Auth: tom+tromey.com X-Email-Count: 8 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfJca2iWSQBmqeVsZw22Q0hBPLBHouPIWYDrFH2+RO0WMkKT+ZnX3+cbNZOWi0X5haQL/NwoMaDImhSduowHiFc9haOctVzjiEnkSNxq+t2PJ2+wRQeRI oRqEx5XYRaOg6Lo8iIwV8l8IPve4DXBT3KfJ2M7w+wTxn1VGMLgRUw6nZkqnRSFJEurRPrgfUI7fUdPzFsMxlCT7LtQvzE9meqc= 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 >>>>> "Tom" == Tom de Vries writes: Tom> - /* Find the section that ADDR is in, and look for the start of the Tom> - section. */ Tom> - struct obj_section *section = find_pc_section (addr); Tom> + /* Find the first section with start address before ADDR, and use its start Tom> + address. The found section may be the one containing ADDR, or the one Tom> + before it. */ Tom> + struct obj_section *section; Tom> + for (int offset = 0; offset <= 1; ++offset) Tom> + { Tom> + section = find_pc_section (addr - offset); Tom> + if (offset == 0 && section != nullptr && section->addr () == addr) Tom> + { Tom> + /* If ADDR is the start of its section, use ADDR - 1. */ Tom> + continue; Tom> + } Tom> + Tom> + break; Tom> + } I was puzzling about this. It seems like it would be ok to always check "addr-1" here? Since if addr is not at the start of the section, it will return that same section. And if addr is at the start of the section, then that's the answer you want? Tom