From: simon.marchi@polymtl.ca
To: gdb-patches@sourceware.org
Cc: Simon Marchi <simon.marchi@polymtl.ca>
Subject: [PATCH 10/10] gdb: rename find_line_pc_range -> find_pc_range_for_sal
Date: Wed, 15 Oct 2025 20:08:04 -0400 [thread overview]
Message-ID: <20251016001154.3969223-11-simon.marchi@polymtl.ca> (raw)
In-Reply-To: <20251016001154.3969223-1-simon.marchi@polymtl.ca>
From: Simon Marchi <simon.marchi@polymtl.ca>
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
next prev parent reply other threads:[~2025-10-16 0:23 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-16 0:07 [PATCH 00/10] Rename some symtab find functions simon.marchi
2025-10-16 0:07 ` [PATCH 01/10] gdb: rename find_pc_function -> find_symbol_for_pc simon.marchi
2025-10-16 0:07 ` [PATCH 02/10] gdb: rename find_pc_sect_function -> find_symbol_for_pc_sect simon.marchi
2025-10-16 0:07 ` [PATCH 03/10] gdb: rename find_pc_sect_containing_function -> find_symbol_for_pc_sect_maybe_inline simon.marchi
2025-10-16 0:07 ` [PATCH 04/10] gdb: rename find_pc_compunit_symtab -> find_compunit_symtab_for_pc simon.marchi
2025-10-16 0:07 ` [PATCH 05/10] gdb: rename find_pc_sect_compunit_symtab -> find_compunit_symtab_for_pc_sect simon.marchi
2025-10-16 0:08 ` [PATCH 06/10] gdb: rename find_pc_line_pc_range -> find_line_pc_range_for_pc simon.marchi
2025-10-16 0:08 ` [PATCH 07/10] gdb: rename find_pc_line -> find_sal_for_pc simon.marchi
2025-10-16 0:08 ` [PATCH 08/10] gdb: rename find_pc_sect_line -> find_sal_for_pc_sect simon.marchi
2025-10-16 0:08 ` [PATCH 09/10] gdb: rename find_pc_line_symtab -> find_symtab_for_pc simon.marchi
2025-10-16 0:08 ` simon.marchi [this message]
2025-10-19 4:07 ` [PATCH 00/10] Rename some symtab find functions Kevin Buettner
2025-10-20 19:41 ` Simon Marchi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251016001154.3969223-11-simon.marchi@polymtl.ca \
--to=simon.marchi@polymtl.ca \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox