From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id MZPLB3vdvWgUlzAAWB0awg (envelope-from ) for ; Sun, 07 Sep 2025 15:31:07 -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=n5SThGz3; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 0DDB91E0BC; Sun, 07 Sep 2025 15:31:07 -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.5 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW, 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 server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (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 98F761E047 for ; Sun, 07 Sep 2025 15:31:05 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 431633858D3C for ; Sun, 7 Sep 2025 19:31:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 431633858D3C 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=n5SThGz3 Received: from omta34.uswest2.a.cloudfilter.net (omta34.uswest2.a.cloudfilter.net [35.89.44.33]) by sourceware.org (Postfix) with ESMTPS id 9D2F33858D38 for ; Sun, 7 Sep 2025 19:29:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9D2F33858D38 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 9D2F33858D38 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=35.89.44.33 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1757273358; cv=none; b=mL68UmrQN+kngRcckna4iLmrio1fmrNUfCXoEQlIle44eAdgKkB0CmU0UsHabn+e5ZP9IOyjZOMZWuFIEzgQPukqRPRM/q1rJp1NwCRkggH/6Bs4AkkD2VFDgADl9Xl7/4POf3Y19QPjalUkWUxy6s2G9HDHx2MpJcBhiib912U= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1757273358; c=relaxed/simple; bh=DlSC56kUfzkvbDUVddHIdaAy2DgU47N3MPeQZn8qL30=; h=DKIM-Signature:From:Date:Subject:MIME-Version:Message-Id:To; b=eehnP5AURNsXsfk9t925XbfC2gdwM2d7Wuh1Z0dhcfm8JsVS9bQ2aWQx8XGJiwWjEt2Y/mY+Il3sLQlJmVQIJimYDxNkA24InmJvBmjGHGEpxPIN0s67hkybYsIkfffrL5QrO6xBxZMUjrL7RmrsGW7OrkQ2nd6Jf8I7tY5E/DM= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from eig-obgw-5004b.ext.cloudfilter.net ([10.0.29.208]) by cmsmtp with ESMTPS id vFDYuymEfLIlMvL4fuB3ox; Sun, 07 Sep 2025 19:29:17 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id vL4eucl1gWIZzvL4euaQUu; Sun, 07 Sep 2025 19:29:16 +0000 X-Authority-Analysis: v=2.4 cv=M7JNKzws c=1 sm=1 tr=0 ts=68bddd0c a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=IkcTkHD0fZMA:10 a=yJojWOMRYYMA:10 a=ItBw4LHWJt0A:10 a=97eHYXKmt6BRGYdAFCYA:9 a=QEXdDO2ut3YA:10 a=VS4QxaUSPT0UtbFnIvSC:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Cc:To:In-Reply-To:References:Message-Id: Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From:Sender: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=f7eToe2a4+VtKFiMei8gzhnJC8A4KOJJAex3ufUla8c=; b=n5SThGz3bXtzkMw8mOAxnzRB0z 3URcHVzP99EO4Ufh+UMjdVs7WNVHZOTk6EPOgPAG/KZtmO3YArB2mzfJPQoJs26A+bJurBunX61qH 9G5i9tkYJmdf4b4O/cNCdd7YS; Received: from 97-122-110-68.hlrn.qwest.net ([97.122.110.68]:43620 helo=[192.168.0.17]) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.1) (envelope-from ) id 1uvL4d-00000003nLh-3V7L; Sun, 07 Sep 2025 13:29:15 -0600 From: Tom Tromey Date: Sun, 07 Sep 2025 13:29:17 -0600 Subject: [PATCH 5/7] Add m_builder member to lnp_state_machine MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20250907-breakpoint-cu-expand-v1-5-dd2beef9d475@tromey.com> References: <20250907-breakpoint-cu-expand-v1-0-dd2beef9d475@tromey.com> In-Reply-To: <20250907-breakpoint-cu-expand-v1-0-dd2beef9d475@tromey.com> To: gdb-patches@sourceware.org Cc: Tom Tromey X-Mailer: b4 0.14.2 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.110.68 X-Source-L: No X-Exim-ID: 1uvL4d-00000003nLh-3V7L X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-122-110-68.hlrn.qwest.net ([192.168.0.17]) [97.122.110.68]:43620 X-Source-Auth: tom+tromey.com X-Email-Count: 6 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfFcmCKC+SrPYP3Ydn1M0+JY7vrYny7y8XNJ2uiDM9PUJ/frnOyDPHdAANFlp/HC8TLmSbhSazecJmhtBmoO37JQcy+x7ihRtAu0IhO1ny61p6uBktsZT EXkrDeMGrNToEft+h3DEjhacS9Fsn1ZL5/jh4fj4rS1TGHbjT9RG33fMEp/VhtQ9YUZ0zKERRNwvxoHy/NQWg7WO7x9dv6V1eWc= 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 I noticed that several spots in lnp_state_machine fetch the CU's builder. Since this can't change over the lifetime of the object, it seemed nicer to simply cache it. --- gdb/dwarf2/line-program.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/gdb/dwarf2/line-program.c b/gdb/dwarf2/line-program.c index e1a9f31bed409884808dd690ada942a58e66dd91..732f6fa13357dfa66c2ba493b186cabbcb08285a 100644 --- a/gdb/dwarf2/line-program.c +++ b/gdb/dwarf2/line-program.c @@ -154,6 +154,9 @@ class lnp_state_machine struct dwarf2_cu *m_cu; + /* The builder associated with the CU. */ + buildsym_compunit *m_builder; + gdbarch *m_gdbarch; /* The line number header. */ @@ -296,7 +299,7 @@ lnp_state_machine::handle_const_add_pc () bool lnp_state_machine::record_line_p () { - if (m_cu->get_builder ()->get_current_subfile () != m_last_subfile) + if (m_builder->get_current_subfile () != m_last_subfile) return true; if (m_line != m_last_line) return true; @@ -398,7 +401,7 @@ lnp_state_machine::record_line (bool end_sequence) address, and we are switching to create a non-stmt line, then discard the new line. */ bool file_changed - = m_last_subfile != m_cu->get_builder ()->get_current_subfile (); + = m_last_subfile != m_builder->get_current_subfile (); bool ignore_this_line = ((file_changed && !end_sequence && m_last_address == m_address && ((m_flags & LEF_IS_STMT) == 0) @@ -419,13 +422,12 @@ lnp_state_machine::record_line (bool end_sequence) if (record_line_p ()) { - buildsym_compunit *builder = m_cu->get_builder (); dwarf_record_line_1 (m_gdbarch, - builder->get_current_subfile (), + m_builder->get_current_subfile (), m_line, m_address, lte_flags, m_currently_recording_lines ? m_cu : nullptr); - m_last_subfile = m_cu->get_builder ()->get_current_subfile (); + m_last_subfile = m_builder->get_current_subfile (); m_last_line = m_line; } } @@ -444,6 +446,7 @@ lnp_state_machine::record_line (bool end_sequence) lnp_state_machine::lnp_state_machine (struct dwarf2_cu *cu, gdbarch *arch, line_header *lh) : m_cu (cu), + m_builder (cu->get_builder ()), m_gdbarch (arch), m_line_header (lh), /* Call `gdbarch_adjust_dwarf2_line' on the initial 0 address as -- 2.49.0