From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id aWW1DjHdvWgUlzAAWB0awg (envelope-from ) for ; Sun, 07 Sep 2025 15:29:53 -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=p2N4SvKG; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 2946B1E0BA; Sun, 07 Sep 2025 15:29:53 -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 AA7131E047 for ; Sun, 07 Sep 2025 15:29:52 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6BBCE3858419 for ; Sun, 7 Sep 2025 19:29:52 +0000 (GMT) Received: from omta34.uswest2.a.cloudfilter.net (omta34.uswest2.a.cloudfilter.net [35.89.44.33]) by sourceware.org (Postfix) with ESMTPS id 9E7943858D37 for ; Sun, 7 Sep 2025 19:29:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9E7943858D37 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 9E7943858D37 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=1757273357; cv=none; b=v4p/JiU3IihXWWqM421Ey419uJhA1G2OLYCbA3lvnmGRPkh9XsAQullGOq70nfGQ2ZBfTVKHR98jmQfE2HkPj7vlDCI5rHB5TzuGpJiUsflvnA7doqD8/hlMluRby/ZrvJecGD9+qGJjjnlrsE3ZtNQF6LUEwZ+I2EMNu0K0MRw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1757273357; c=relaxed/simple; bh=9qeJl/3zwK/vduFpLVIauoxdeUiHCL/qMeRfPR7zW+U=; h=DKIM-Signature:From:Date:Subject:MIME-Version:Message-Id:To; b=uynp90TRo2cvTdR17Np0Z7xz67PTKy85n2h+cYgkbFTHUH+HP5Zo2ePAP9zKOwcb6uLBN9vjFUIfqivO/LNlXNeiIPBlYWavOnd6WyWbrwpkQSZef9UKr3u9bC6PzcHUKPUZE5sxFMdXjaPuvJ8Sv36D3fUyxC7uVcrOciInTPw= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from eig-obgw-5007b.ext.cloudfilter.net ([10.0.29.167]) by cmsmtp with ESMTPS id vD7suyS2sLIlMvL4euB3ot; Sun, 07 Sep 2025 19:29:16 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id vL4duass2EYttvL4eubQUs; Sun, 07 Sep 2025 19:29:16 +0000 X-Authority-Analysis: v=2.4 cv=K6MiHzWI c=1 sm=1 tr=0 ts=68bddd0c a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=IkcTkHD0fZMA:10 a=yJojWOMRYYMA:10 a=ItBw4LHWJt0A:10 a=usuRZFtUc3MWntdVHcYA: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=a0UEa6NYYvrMUA9aMuSEY9rqLdLc7EIs6qlvYLut9L8=; b=p2N4SvKGFSBv7INPj6Cqp/Mqlb tocFU5Mqa5hnbF+v0LQb+ZBITlDuRpVOWuW2BFAIAn1BQ4xe4A1cfagghKLlbYJrqhDsgqrIIc7uU JNDY/Q5yo2tklOvTOFIDgFFWr; 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-2aon; Sun, 07 Sep 2025 13:29:15 -0600 From: Tom Tromey Date: Sun, 07 Sep 2025 13:29:16 -0600 Subject: [PATCH 4/7] Change dwarf_record_line_p to be a method MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20250907-breakpoint-cu-expand-v1-4-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-2aon 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: 5 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfE8GRXOkpDbi42xt5/hGQDsECWfgHFN5+ccjglIFd7+QBkqiGhq2EG7O9TRbMqAaq/4ZzEVMPGH5SHoWhE5eFxUEpGaybOVOcSOqLgDH7wpESHk7Ci8m RqRzIyHoewVvb70RaLM/lnklb1/EaQc/nt/vLLyyOLCcJUcWYbF4rd7aUBZ353F6XRkb066D5ny0woy78xlOJiPrzEa+4Ck965k= 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 This changes dwarf_record_line_p to be a method of lnp_state_machine. This simplifies it, as it can refer to members of the object. --- gdb/dwarf2/line-program.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/gdb/dwarf2/line-program.c b/gdb/dwarf2/line-program.c index 5292d3d5e86722bc6d60b049740982c06550ef76..e1a9f31bed409884808dd690ada942a58e66dd91 100644 --- a/gdb/dwarf2/line-program.c +++ b/gdb/dwarf2/line-program.c @@ -150,6 +150,8 @@ class lnp_state_machine m_line_has_non_zero_discriminator = m_discriminator != 0; } + bool record_line_p (); + struct dwarf2_cu *m_cu; gdbarch *m_gdbarch; @@ -291,20 +293,17 @@ lnp_state_machine::handle_const_add_pc () Note: Addresses in the line number state machine can never go backwards within one sequence, thus this coalescing is ok. */ -static bool -dwarf_record_line_p (struct dwarf2_cu *cu, - unsigned int line, unsigned int last_line, - int line_has_non_zero_discriminator, - struct subfile *last_subfile) +bool +lnp_state_machine::record_line_p () { - if (cu->get_builder ()->get_current_subfile () != last_subfile) + if (m_cu->get_builder ()->get_current_subfile () != m_last_subfile) return true; - if (line != last_line) + if (m_line != m_last_line) return true; /* Same line for the same file that we've seen already. As a last check, for pr 17276, only record the line if the line has never had a non-zero discriminator. */ - if (!line_has_non_zero_discriminator) + if (!m_line_has_non_zero_discriminator) return true; return false; } @@ -418,9 +417,7 @@ lnp_state_machine::record_line (bool end_sequence) if (m_cu->producer_is_codewarrior ()) lte_flags |= LEF_IS_STMT; - if (dwarf_record_line_p (m_cu, m_line, m_last_line, - m_line_has_non_zero_discriminator, - m_last_subfile)) + if (record_line_p ()) { buildsym_compunit *builder = m_cu->get_builder (); dwarf_record_line_1 (m_gdbarch, -- 2.49.0