From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 2SOAAew68GigaTYAWB0awg (envelope-from ) for ; Wed, 15 Oct 2025 20:23:08 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=polymtl.ca header.i=@polymtl.ca header.a=rsa-sha256 header.s=oct2025 header.b=SOhqopXT; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id F11921E0BA; Wed, 15 Oct 2025 20:23: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=-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 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 354D41E047 for ; Wed, 15 Oct 2025 20:23:07 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 56FCF3858CB6 for ; Thu, 16 Oct 2025 00:23:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 56FCF3858CB6 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=polymtl.ca header.i=@polymtl.ca header.a=rsa-sha256 header.s=oct2025 header.b=SOhqopXT Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 339AB3857C5F for ; Thu, 16 Oct 2025 00:14:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 339AB3857C5F Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=polymtl.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=polymtl.ca ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 339AB3857C5F Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=132.207.4.11 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1760573646; cv=none; b=aPZXwMzA6/pjH+Um6jXaQoGOT1pS4/nsNRYHbiQRJ5YhYvtznU7kJ/Zk896267Ie3nXDVj1dNGvemkecMcKTlQ/FLZSQC1Qz2mS6UaeaHKZkBBFokBQ/F9hgCBSY3IQ21eb9nq+ujN8dfMAAJZhcshtDdKXsP69GerFmqOFCpiQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1760573646; c=relaxed/simple; bh=pO3USHzfnyeO7g3XhYDCX3SNIvJaXWRjGUj8wn5s/TE=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=PlkIzA3KPPVdFq56hvlGs5m5loGmF/rgCV60MpuH/rVjJh+qQ1QjZGgAoQ/z9LPp/7AeSHji4onCLxHVimKb52OwrWREhe4P/3sYIIjLNm6EEdE++6xGKQH+dmLHy5RUarmPegaKUAkp6V4gDPDJDpJ6ZHzCwzgmvjqpW89zaRU= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 339AB3857C5F Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 59G0E0fe070345 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 15 Oct 2025 20:14:05 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 59G0E0fe070345 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polymtl.ca; s=oct2025; t=1760573645; bh=5vlO89RzqIg05l8Qs2nGwbISe23XMxg/F9cttkHU+6Q=; h=From:To:Cc:Subject:Date:In-Reply-To:From; b=SOhqopXTndMxSkkJQCgCE03I9nZIYTN3SPBgQ8bZfdmBhX0GynjVABcaYagIQBt96 gCviky3A5YowLa6bH9DX/aA8fr4mIOpNCX78mMdNt1d4APBUwWMoHDpafoOmhRvfL/ ZGCW/B7PXH8GGSrTega31FNr9ZVWfIDrfEwgLDxb0PZuHABkhmmAejDWfayjjwGVQC UT+APF/jSphBzIJ4ybCs5pIWHsjfghmTHnkeXnySA4W8SL5176WCJzMg9i6UPH8j5D dsQCRdkGBONEGSIifBtF4S2LgrrIDjd01gaBqJrw0P8t4sYEDla2kDzFv0f7xlwWu+ 4TFcPr0aqHmPg== Received: by simark.ca (Postfix) id A05901E0BA; Wed, 15 Oct 2025 20:14:00 -0400 (EDT) From: simon.marchi@polymtl.ca To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH 10/10] gdb: rename find_line_pc_range -> find_pc_range_for_sal Date: Wed, 15 Oct 2025 20:08:04 -0400 Message-ID: <20251016001154.3969223-11-simon.marchi@polymtl.ca> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251016001154.3969223-1-simon.marchi@polymtl.ca> References: <20251016001154.3969223-1-simon.marchi@polymtl.ca> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Thu, 16 Oct 2025 00:14:00 +0000 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 From: Simon Marchi Change-Id: Ibd1692292dfcad088ae74b797c38a483080f2ec1 --- gdb/breakpoint.c | 8 ++++---- gdb/mi/mi-cmd-disas.c | 2 +- gdb/mi/mi-main.c | 2 +- gdb/source.c | 2 +- gdb/symtab.c | 6 +++--- gdb/symtab.h | 6 +++--- gdb/tracepoint.c | 4 ++-- gdb/tui/tui-disasm.c | 2 +- gdb/tui/tui-source.c | 4 ++-- gdb/tui/tui-winsource.c | 2 +- 10 files changed, 19 insertions(+), 19 deletions(-) diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index a2c326b9f3fe..494a1773e16b 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -9482,7 +9482,7 @@ resolve_sal_pc (struct symtab_and_line *sal) if (sal->pc == 0 && sal->symtab != NULL) { - if (!find_line_pc (sal->symtab, sal->line, &pc)) + if (!find_pc_for_line (sal->symtab, sal->line, &pc)) error (_("No line %d in file \"%s\"."), sal->line, symtab_to_filename_for_display (sal->symtab)); sal->pc = pc; @@ -9735,11 +9735,11 @@ find_breakpoint_range_end (struct symtab_and_line sal) int ret; CORE_ADDR start; - ret = find_line_pc_range (sal, &start, &end); + ret = find_pc_range_for_sal (sal, &start, &end); if (!ret) error (_("Could not find location of the end of the range.")); - /* find_line_pc_range returns the start of the next line. */ + /* find_pc_range_for_sal returns the start of the next line. */ end--; } @@ -12851,7 +12851,7 @@ update_static_tracepoint (tracepoint *tp, struct symtab_and_line sal) pc = sal.pc; if (sal.line) - find_line_pc (sal.symtab, sal.line, &pc); + find_pc_for_line (sal.symtab, sal.line, &pc); if (target_static_tracepoint_marker_at (pc, &marker)) { diff --git a/gdb/mi/mi-cmd-disas.c b/gdb/mi/mi-cmd-disas.c index cb839e742ff6..6051cbadefc9 100644 --- a/gdb/mi/mi-cmd-disas.c +++ b/gdb/mi/mi-cmd-disas.c @@ -248,7 +248,7 @@ mi_cmd_disassemble (const char *command, const char *const *argv, int argc) s = lookup_symtab (current_program_space, file_string); if (s == NULL) error (_("-data-disassemble: Invalid filename.")); - if (!find_line_pc (s, line_num, &start)) + if (!find_pc_for_line (s, line_num, &start)) error (_("-data-disassemble: Invalid line number")); if (find_pc_partial_function (start, NULL, &low, &high) == 0) error (_("-data-disassemble: " diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c index bf1070030e27..2d91bb1667bf 100644 --- a/gdb/mi/mi-main.c +++ b/gdb/mi/mi-main.c @@ -2355,7 +2355,7 @@ mi_cmd_trace_find (const char *command, const char *const *argv, int argc) error (_("Could not find the specified line")); CORE_ADDR start_pc, end_pc; - if (sal.line > 0 && find_line_pc_range (sal, &start_pc, &end_pc)) + if (sal.line > 0 && find_pc_range_for_sal (sal, &start_pc, &end_pc)) tfind_1 (tfind_range, 0, start_pc, end_pc - 1, 0); else error (_("Could not find the specified line")); diff --git a/gdb/source.c b/gdb/source.c index 1018d2ce6be3..27fa657afb81 100644 --- a/gdb/source.c +++ b/gdb/source.c @@ -1574,7 +1574,7 @@ info_line_command (const char *arg, int from_tty) gdb_printf ("\n"); } else if (sal.line > 0 - && find_line_pc_range (sal, &start_pc, &end_pc)) + && find_pc_range_for_sal (sal, &start_pc, &end_pc)) { gdbarch *gdbarch = sal.symtab->compunit ()->objfile ()->arch (); diff --git a/gdb/symtab.c b/gdb/symtab.c index bb17276102f9..fdba441ec541 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -3390,7 +3390,7 @@ find_pcs_for_symtab_line (struct symtab *symtab, int line, The source file is specified with a struct symtab. */ bool -find_line_pc (struct symtab *symtab, int line, CORE_ADDR *pc) +find_pc_for_line (struct symtab *symtab, int line, CORE_ADDR *pc) { const struct linetable *l; int ind; @@ -3417,14 +3417,14 @@ find_line_pc (struct symtab *symtab, int line, CORE_ADDR *pc) Returns false if could not find the specified line. */ bool -find_line_pc_range (struct symtab_and_line sal, CORE_ADDR *startptr, +find_pc_range_for_sal (struct symtab_and_line sal, CORE_ADDR *startptr, CORE_ADDR *endptr) { CORE_ADDR startaddr; struct symtab_and_line found_sal; startaddr = sal.pc; - if (startaddr == 0 && !find_line_pc (sal.symtab, sal.line, &startaddr)) + if (startaddr == 0 && !find_pc_for_line (sal.symtab, sal.line, &startaddr)) return false; /* This whole function is based on address. For example, if line 10 has diff --git a/gdb/symtab.h b/gdb/symtab.h index 3a2088cb6af3..6c19f138c2f4 100644 --- a/gdb/symtab.h +++ b/gdb/symtab.h @@ -2434,10 +2434,10 @@ extern struct symtab *find_symtab_for_pc (CORE_ADDR); /* Given a symtab and line number, return the pc there. */ -extern bool find_line_pc (struct symtab *, int, CORE_ADDR *); +extern bool find_pc_for_line (struct symtab *, int, CORE_ADDR *); -extern bool find_line_pc_range (struct symtab_and_line, CORE_ADDR *, - CORE_ADDR *); +extern bool find_pc_range_for_sal (struct symtab_and_line, CORE_ADDR *, + CORE_ADDR *); extern void resolve_sal_pc (struct symtab_and_line *); diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c index c0db7c8e6fa4..9b84fbe384ab 100644 --- a/gdb/tracepoint.c +++ b/gdb/tracepoint.c @@ -2347,7 +2347,7 @@ tfind_line_command (const char *args, int from_tty) error (_("No line number information available.")); CORE_ADDR start_pc, end_pc; - if (sal.line > 0 && find_line_pc_range (sal, &start_pc, &end_pc)) + if (sal.line > 0 && find_pc_range_for_sal (sal, &start_pc, &end_pc)) { if (start_pc == end_pc) { @@ -2362,7 +2362,7 @@ tfind_line_command (const char *args, int from_tty) gdb_printf (" but contains no code.\n"); sal = find_sal_for_pc (start_pc, 0); if (sal.line > 0 - && find_line_pc_range (sal, &start_pc, &end_pc) + && find_pc_range_for_sal (sal, &start_pc, &end_pc) && start_pc != end_pc) gdb_printf ("Attempting to find line %ps instead.\n", styled_string (line_number_style.style (), diff --git a/gdb/tui/tui-disasm.c b/gdb/tui/tui-disasm.c index 07453b4ea5e7..b49a33b84136 100644 --- a/gdb/tui/tui-disasm.c +++ b/gdb/tui/tui-disasm.c @@ -401,7 +401,7 @@ tui_get_begin_asm_address (struct gdbarch **gdbarch_p, CORE_ADDR *addr_p) = get_current_source_symtab_and_line (current_program_space); if (sal.symtab != nullptr) - find_line_pc (sal.symtab, sal.line, &addr); + find_pc_for_line (sal.symtab, sal.line, &addr); } if (addr == 0) diff --git a/gdb/tui/tui-source.c b/gdb/tui/tui-source.c index 9485ad960022..4a2f42352739 100644 --- a/gdb/tui/tui-source.c +++ b/gdb/tui/tui-source.c @@ -172,7 +172,7 @@ tui_source_window::do_scroll_vertical (int num_to_scroll) line_no = m_start_line_or_addr.u.line_no; cursal.line = line_no; - find_line_pc (cursal.symtab, cursal.line, &cursal.pc); + find_pc_for_line (cursal.symtab, cursal.line, &cursal.pc); for (struct tui_source_window_base *win_info : tui_source_windows ()) win_info->update_source_window_as_is (arch, cursal); } @@ -238,7 +238,7 @@ tui_source_window::display_start_addr (struct gdbarch **gdbarch_p, symtab_and_line cursal = get_current_source_symtab_and_line (current_program_space); *gdbarch_p = m_gdbarch; - find_line_pc (cursal.symtab, m_start_line_or_addr.u.line_no, addr_p); + find_pc_for_line (cursal.symtab, m_start_line_or_addr.u.line_no, addr_p); } /* See tui-winsource.h. */ diff --git a/gdb/tui/tui-winsource.c b/gdb/tui/tui-winsource.c index 27f682b7ea80..e6bbe1535a30 100644 --- a/gdb/tui/tui-winsource.c +++ b/gdb/tui/tui-winsource.c @@ -208,7 +208,7 @@ tui_update_source_windows_with_line (struct symtab_and_line sal) struct gdbarch *gdbarch = nullptr; if (sal.symtab != nullptr) { - find_line_pc (sal.symtab, sal.line, &sal.pc); + find_pc_for_line (sal.symtab, sal.line, &sal.pc); gdbarch = sal.symtab->compunit ()->objfile ()->arch (); } -- 2.51.0