mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-11-16 12:34:43 +00:00
gdb: rename find_line_pc_range -> find_pc_range_for_sal
Change-Id: Ibd1692292dfcad088ae74b797c38a483080f2ec1 Approved-by: Kevin Buettner <kevinb@redhat.com>
This commit is contained in:
committed by
Simon Marchi
parent
179801c964
commit
de49e8229b
@@ -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))
|
||||
{
|
||||
|
||||
@@ -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: "
|
||||
|
||||
@@ -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"));
|
||||
|
||||
@@ -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 ();
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 *);
|
||||
|
||||
|
||||
@@ -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 (),
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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. */
|
||||
|
||||
@@ -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 ();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user