mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-11-16 12:34:43 +00:00
gdb: rename find_pc_line -> find_sal_for_pc
Change-Id: I293b655e8753fc650f3ec10bb4e34a9632d8e377 Approved-by: Kevin Buettner <kevinb@redhat.com>
This commit is contained in:
committed by
Simon Marchi
parent
36eb83e749
commit
2fe07655c6
@@ -1026,7 +1026,7 @@ aarch64_scan_prologue (const frame_info_ptr &this_frame,
|
||||
if (find_pc_partial_function (block_addr, NULL, &prologue_start,
|
||||
&prologue_end))
|
||||
{
|
||||
struct symtab_and_line sal = find_pc_line (prologue_start, 0);
|
||||
struct symtab_and_line sal = find_sal_for_pc (prologue_start, 0);
|
||||
|
||||
if (sal.line == 0)
|
||||
{
|
||||
|
||||
@@ -637,7 +637,7 @@ alpha_after_prologue (CORE_ADDR pc)
|
||||
if (!find_pc_partial_function (pc, NULL, &func_addr, &func_end))
|
||||
return 0;
|
||||
|
||||
sal = find_pc_line (func_addr, 0);
|
||||
sal = find_sal_for_pc (func_addr, 0);
|
||||
if (sal.end < func_end)
|
||||
return sal.end;
|
||||
|
||||
|
||||
@@ -1663,7 +1663,7 @@ arc_make_frame_cache (const frame_info_ptr &this_frame)
|
||||
CORE_ADDR entrypoint, prologue_end;
|
||||
if (find_pc_partial_function (block_addr, NULL, &entrypoint, &prologue_end))
|
||||
{
|
||||
struct symtab_and_line sal = find_pc_line (entrypoint, 0);
|
||||
struct symtab_and_line sal = find_sal_for_pc (entrypoint, 0);
|
||||
CORE_ADDR prev_pc = get_frame_pc (this_frame);
|
||||
if (sal.line == 0)
|
||||
/* No line info so use current PC. */
|
||||
|
||||
@@ -1035,7 +1035,7 @@ arm_linux_copy_svc (struct gdbarch *gdbarch, struct regcache *regs,
|
||||
gdb_assert (inferior_thread ()->control.step_resume_breakpoint
|
||||
== NULL);
|
||||
|
||||
sal = find_pc_line (return_to, 0);
|
||||
sal = find_sal_for_pc (return_to, 0);
|
||||
sal.pc = return_to;
|
||||
sal.section = find_pc_overlay (return_to);
|
||||
sal.explicit_pc = 1;
|
||||
|
||||
@@ -2238,7 +2238,7 @@ arm_scan_prologue (const frame_info_ptr &this_frame,
|
||||
/* One way to find the end of the prologue (which works well
|
||||
for unoptimized code) is to do the following:
|
||||
|
||||
struct symtab_and_line sal = find_pc_line (prologue_start, 0);
|
||||
struct symtab_and_line sal = find_sal_for_pc (prologue_start, 0);
|
||||
|
||||
if (sal.line == 0)
|
||||
prologue_end = prev_pc;
|
||||
|
||||
@@ -8537,7 +8537,7 @@ set_momentary_breakpoint_at_pc (struct gdbarch *gdbarch, CORE_ADDR pc,
|
||||
{
|
||||
struct symtab_and_line sal;
|
||||
|
||||
sal = find_pc_line (pc, 0);
|
||||
sal = find_sal_for_pc (pc, 0);
|
||||
sal.pc = pc;
|
||||
sal.section = find_pc_overlay (pc);
|
||||
sal.explicit_pc = 1;
|
||||
@@ -9009,11 +9009,11 @@ parse_breakpoint_sals (location_spec *locspec,
|
||||
corresponding to the last call to print_frame_info.
|
||||
Be sure to reinitialize LINE with NOTCURRENT == 0
|
||||
as the breakpoint line number is inappropriate otherwise.
|
||||
find_pc_line would adjust PC, re-set it back. */
|
||||
find_sal_for_pc would adjust PC, re-set it back. */
|
||||
symtab_and_line sal = get_last_displayed_sal ();
|
||||
CORE_ADDR pc = sal.pc;
|
||||
|
||||
sal = find_pc_line (pc, 0);
|
||||
sal = find_sal_for_pc (pc, 0);
|
||||
|
||||
/* "break" without arguments is equivalent to "break *PC"
|
||||
where PC is the last displayed codepoint's address. So
|
||||
@@ -9131,7 +9131,7 @@ decode_static_tracepoint_spec (const char **arg_p)
|
||||
|
||||
for (const static_tracepoint_marker &marker : markers)
|
||||
{
|
||||
symtab_and_line sal = find_pc_line (marker.address, 0);
|
||||
symtab_and_line sal = find_sal_for_pc (marker.address, 0);
|
||||
sal.pc = marker.address;
|
||||
sals.push_back (sal);
|
||||
}
|
||||
@@ -10979,7 +10979,7 @@ until_break_command (const char *arg, int from_tty, int anywhere)
|
||||
struct symtab_and_line sal2;
|
||||
struct gdbarch *caller_gdbarch;
|
||||
|
||||
sal2 = find_pc_line (frame_unwind_caller_pc (frame), 0);
|
||||
sal2 = find_sal_for_pc (frame_unwind_caller_pc (frame), 0);
|
||||
sal2.pc = frame_unwind_caller_pc (frame);
|
||||
caller_gdbarch = frame_unwind_caller_arch (frame);
|
||||
|
||||
@@ -12890,7 +12890,7 @@ update_static_tracepoint (tracepoint *tp, struct symtab_and_line sal)
|
||||
"found at previous line number"),
|
||||
tp->number, tp->static_trace_marker_id.c_str ());
|
||||
|
||||
symtab_and_line sal2 = find_pc_line (tpmarker->address, 0);
|
||||
symtab_and_line sal2 = find_sal_for_pc (tpmarker->address, 0);
|
||||
sym = find_symbol_for_pc_sect (tpmarker->address, NULL);
|
||||
uiout->text ("Now in ");
|
||||
if (sym)
|
||||
@@ -13989,7 +13989,7 @@ insert_single_step_breakpoint (struct gdbarch *gdbarch,
|
||||
= add_to_breakpoint_chain (std::move (b));
|
||||
}
|
||||
|
||||
sal = find_pc_line (pc, 0);
|
||||
sal = find_sal_for_pc (pc, 0);
|
||||
sal.pc = pc;
|
||||
sal.section = find_pc_overlay (pc);
|
||||
sal.explicit_pc = 1;
|
||||
|
||||
@@ -3504,7 +3504,7 @@ c_parse (struct parser_state *par_state)
|
||||
|
||||
if (par_state->expression_context_block)
|
||||
macro_scope
|
||||
= sal_macro_scope (find_pc_line (par_state->expression_context_pc, 0));
|
||||
= sal_macro_scope (find_sal_for_pc (par_state->expression_context_pc, 0));
|
||||
else
|
||||
macro_scope = default_macro_scope ();
|
||||
if (!macro_scope.is_valid ())
|
||||
|
||||
@@ -1312,7 +1312,7 @@ list_command (const char *arg, int from_tty)
|
||||
selected frame, and finding the line associated to it. */
|
||||
frame_info_ptr frame = get_selected_frame (nullptr);
|
||||
CORE_ADDR curr_pc = get_frame_pc (frame);
|
||||
cursal = find_pc_line (curr_pc, 0);
|
||||
cursal = find_sal_for_pc (curr_pc, 0);
|
||||
|
||||
if (cursal.symtab == nullptr)
|
||||
error
|
||||
|
||||
@@ -188,7 +188,7 @@ write_macro_definitions (const struct block *block, CORE_ADDR pc,
|
||||
macro_scope scope;
|
||||
|
||||
if (block != NULL)
|
||||
scope = sal_macro_scope (find_pc_line (pc, 0));
|
||||
scope = sal_macro_scope (find_sal_for_pc (pc, 0));
|
||||
else
|
||||
scope = default_macro_scope ();
|
||||
if (!scope.is_valid ())
|
||||
|
||||
@@ -416,7 +416,7 @@ cp_lookup_symbol_via_imports (const char *scope,
|
||||
|
||||
/* Due to a GCC bug, we need to know the boundaries of the current block
|
||||
to know if a certain using directive is valid. */
|
||||
symtab_and_line boundary_sal = find_pc_line (block->end () - 1, 0);
|
||||
symtab_and_line boundary_sal = find_sal_for_pc (block->end () - 1, 0);
|
||||
|
||||
/* Go through the using directives. If any of them add new names to
|
||||
the namespace we're searching in, see if we can find a match by
|
||||
|
||||
@@ -1343,7 +1343,7 @@ cris_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
|
||||
should the first assembly instruction of the first source line. */
|
||||
if (find_pc_partial_function (pc, NULL, &func_addr, &func_end))
|
||||
{
|
||||
sal = find_pc_line (func_addr, 0);
|
||||
sal = find_sal_for_pc (func_addr, 0);
|
||||
if (sal.end > 0 && sal.end < func_end)
|
||||
return sal.end;
|
||||
}
|
||||
|
||||
@@ -594,7 +594,7 @@ do_mixed_source_and_assembly_deprecated
|
||||
{
|
||||
mle[newlines].line = le[i].line;
|
||||
mle[newlines].start_pc = le[i].pc (objfile);
|
||||
sal = find_pc_line (le[i].pc (objfile), 0);
|
||||
sal = find_sal_for_pc (le[i].pc (objfile), 0);
|
||||
mle[newlines].end_pc = sal.end;
|
||||
newlines++;
|
||||
}
|
||||
@@ -712,7 +712,7 @@ do_mixed_source_and_assembly (struct gdbarch *gdbarch,
|
||||
|
||||
/* The prologue may be empty, but there may still be a line number entry
|
||||
for the opening brace which is distinct from the first line of code.
|
||||
If the prologue has been eliminated find_pc_line may return the source
|
||||
If the prologue has been eliminated find_sal_for_pc may return the source
|
||||
line after the opening brace. We still want to print this opening brace.
|
||||
first_le is used to implement this. */
|
||||
|
||||
@@ -733,7 +733,7 @@ do_mixed_source_and_assembly (struct gdbarch *gdbarch,
|
||||
struct symtab_and_line sal;
|
||||
int length;
|
||||
|
||||
sal = find_pc_line (pc, 0);
|
||||
sal = find_sal_for_pc (pc, 0);
|
||||
length = gdb_insn_length (gdbarch, pc);
|
||||
pc += length;
|
||||
|
||||
@@ -782,7 +782,7 @@ do_mixed_source_and_assembly (struct gdbarch *gdbarch,
|
||||
int end_preceding_line_to_display = 0;
|
||||
int new_source_line = 0;
|
||||
|
||||
sal = find_pc_line (pc, 0);
|
||||
sal = find_sal_for_pc (pc, 0);
|
||||
|
||||
if (sal.symtab != last_symtab)
|
||||
{
|
||||
|
||||
@@ -973,7 +973,7 @@ elf_gnu_ifunc_resolver_stop (code_breakpoint *b)
|
||||
|
||||
if (b_return == b)
|
||||
{
|
||||
/* No need to call find_pc_line for symbols resolving as this is only
|
||||
/* No need to call find_sal_for_pc for symbols resolving as this is only
|
||||
a helper breakpoint never shown to the user. */
|
||||
|
||||
symtab_and_line sal;
|
||||
|
||||
@@ -2916,7 +2916,7 @@ find_frame_sal (const frame_info_ptr &frame)
|
||||
return {};
|
||||
|
||||
notcurrent = (*pc != get_frame_address_in_block (frame));
|
||||
return find_pc_line (*pc, notcurrent);
|
||||
return find_sal_for_pc (*pc, notcurrent);
|
||||
}
|
||||
|
||||
/* Per "frame.h", return the ``address'' of the frame. Code should
|
||||
|
||||
@@ -986,7 +986,7 @@ frv_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
|
||||
{
|
||||
struct symtab_and_line sal;
|
||||
|
||||
sal = find_pc_line (func_addr, 0);
|
||||
sal = find_sal_for_pc (func_addr, 0);
|
||||
|
||||
if (sal.line != 0 && sal.end < func_end)
|
||||
{
|
||||
|
||||
@@ -303,7 +303,7 @@ ft32_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
|
||||
/* Don't use line number debug info for assembly source files. */
|
||||
if ((sym != NULL) && sym->language () != language_asm)
|
||||
{
|
||||
sal = find_pc_line (func_addr, 0);
|
||||
sal = find_sal_for_pc (func_addr, 0);
|
||||
if (sal.end && sal.end < func_end)
|
||||
{
|
||||
/* Found a line number, use it as end of prologue. */
|
||||
|
||||
@@ -592,7 +592,7 @@ gdbscm_find_pc_line (SCM pc_scm)
|
||||
{
|
||||
CORE_ADDR pc = (CORE_ADDR) pc_ull;
|
||||
|
||||
sal = find_pc_line (pc, 0);
|
||||
sal = find_sal_for_pc (pc, 0);
|
||||
}
|
||||
catch (const gdb_exception &except)
|
||||
{
|
||||
|
||||
@@ -536,7 +536,7 @@ h8300_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
|
||||
struct h8300_frame_cache cache;
|
||||
|
||||
/* Found a function. */
|
||||
sal = find_pc_line (func_addr, 0);
|
||||
sal = find_sal_for_pc (func_addr, 0);
|
||||
if (sal.end && sal.end < func_end)
|
||||
/* Found a line number, use it as end of prologue. */
|
||||
return sal.end;
|
||||
|
||||
@@ -1774,7 +1774,7 @@ after_prologue (CORE_ADDR pc)
|
||||
return 0;
|
||||
|
||||
/* Get the line associated with FUNC_ADDR. */
|
||||
sal = find_pc_line (func_addr, 0);
|
||||
sal = find_sal_for_pc (func_addr, 0);
|
||||
|
||||
/* There are only two cases to consider. First, the end of the source line
|
||||
is within the function bounds. In that case we return the end of the
|
||||
|
||||
@@ -1283,7 +1283,7 @@ refine_prologue_limit (CORE_ADDR pc, CORE_ADDR lim_pc, int *trust_limit)
|
||||
/* Start off not trusting the limit. */
|
||||
*trust_limit = 0;
|
||||
|
||||
prologue_sal = find_pc_line (pc, 0);
|
||||
prologue_sal = find_sal_for_pc (pc, 0);
|
||||
if (prologue_sal.line != 0)
|
||||
{
|
||||
int i;
|
||||
@@ -1302,7 +1302,7 @@ refine_prologue_limit (CORE_ADDR pc, CORE_ADDR lim_pc, int *trust_limit)
|
||||
{
|
||||
struct symtab_and_line sal;
|
||||
|
||||
sal = find_pc_line (addr, 0);
|
||||
sal = find_sal_for_pc (addr, 0);
|
||||
if (sal.line == 0)
|
||||
break;
|
||||
if (sal.line <= prologue_sal.line
|
||||
|
||||
10
gdb/infcmd.c
10
gdb/infcmd.c
@@ -970,9 +970,9 @@ prepare_one_step (thread_info *tp, struct step_command_fsm *sm)
|
||||
|
||||
if (execution_direction == EXEC_REVERSE)
|
||||
{
|
||||
symtab_and_line sal = find_pc_line (pc, 0);
|
||||
symtab_and_line sal = find_sal_for_pc (pc, 0);
|
||||
symtab_and_line sal_start
|
||||
= find_pc_line (tp->control.step_range_start, 0);
|
||||
= find_sal_for_pc (tp->control.step_range_start, 0);
|
||||
|
||||
if (sal.line == sal_start.line)
|
||||
/* Executing in reverse, the step_range_start address is in
|
||||
@@ -1368,7 +1368,7 @@ until_next_command (int from_tty)
|
||||
}
|
||||
else
|
||||
{
|
||||
sal = find_pc_line (pc, 0);
|
||||
sal = find_sal_for_pc (pc, 0);
|
||||
|
||||
tp->control.step_range_start = func->value_block ()->entry_pc ();
|
||||
tp->control.step_range_end = sal.end;
|
||||
@@ -1669,7 +1669,7 @@ finish_backward (struct finish_command_fsm *sm)
|
||||
if (find_pc_partial_function (pc, nullptr, &func_addr, nullptr) == 0)
|
||||
error (_("Cannot find bounds of current function"));
|
||||
|
||||
sal = find_pc_line (func_addr, 0);
|
||||
sal = find_sal_for_pc (func_addr, 0);
|
||||
alt_entry_point = sal.pc;
|
||||
entry_point = alt_entry_point;
|
||||
|
||||
@@ -1728,7 +1728,7 @@ finish_forward (struct finish_command_fsm *sm, const frame_info_ptr &frame)
|
||||
struct symtab_and_line sal;
|
||||
struct thread_info *tp = inferior_thread ();
|
||||
|
||||
sal = find_pc_line (get_frame_pc (frame), 0);
|
||||
sal = find_sal_for_pc (get_frame_pc (frame), 0);
|
||||
sal.pc = get_frame_pc (frame);
|
||||
|
||||
sm->breakpoint = set_momentary_breakpoint (gdbarch, sal,
|
||||
|
||||
@@ -7969,7 +7969,7 @@ process_event_stop_test (struct execution_control_state *ecs)
|
||||
{
|
||||
struct symtab_and_line tmp_sal;
|
||||
|
||||
tmp_sal = find_pc_line (ecs->stop_func_start, 0);
|
||||
tmp_sal = find_sal_for_pc (ecs->stop_func_start, 0);
|
||||
if (tmp_sal.line != 0
|
||||
&& !function_name_is_marked_for_skip (ecs->stop_func_name,
|
||||
tmp_sal)
|
||||
@@ -8058,7 +8058,7 @@ process_event_stop_test (struct execution_control_state *ecs)
|
||||
stack of inlined frames, even if GDB actually believes that it is in a
|
||||
more outer frame. This is checked for below by calls to
|
||||
inline_skipped_frames. */
|
||||
stop_pc_sal = find_pc_line (ecs->event_thread->stop_pc (), 0);
|
||||
stop_pc_sal = find_sal_for_pc (ecs->event_thread->stop_pc (), 0);
|
||||
|
||||
/* NOTE: tausq/2004-05-24: This if block used to be done before all
|
||||
the trampoline processing logic, however, there are some trampolines
|
||||
@@ -8676,7 +8676,7 @@ handle_step_into_function (struct gdbarch *gdbarch,
|
||||
ecs->stop_func_start
|
||||
= gdbarch_skip_prologue_noexcept (gdbarch, ecs->stop_func_start);
|
||||
|
||||
symtab_and_line stop_func_sal = find_pc_line (ecs->stop_func_start, 0);
|
||||
symtab_and_line stop_func_sal = find_sal_for_pc (ecs->stop_func_start, 0);
|
||||
/* Use the step_resume_break to step until the end of the prologue,
|
||||
even if that involves jumps (as it seems to on the vax under
|
||||
4.2). */
|
||||
@@ -8755,7 +8755,7 @@ handle_step_into_function_backward (struct gdbarch *gdbarch,
|
||||
ecs->stop_func_start
|
||||
= gdbarch_skip_prologue_noexcept (gdbarch, ecs->stop_func_start);
|
||||
|
||||
stop_func_sal = find_pc_line (ecs->event_thread->stop_pc (), 0);
|
||||
stop_func_sal = find_sal_for_pc (ecs->event_thread->stop_pc (), 0);
|
||||
|
||||
/* OK, we're just going to keep stepping here. */
|
||||
if (stop_func_sal.pc == ecs->event_thread->stop_pc ())
|
||||
|
||||
@@ -170,7 +170,7 @@ iq2000_register_name (struct gdbarch *gdbarch, int regnum)
|
||||
static struct symtab_and_line
|
||||
find_last_line_symbol (CORE_ADDR start, CORE_ADDR end, int notcurrent)
|
||||
{
|
||||
struct symtab_and_line sal = find_pc_line (start, notcurrent);
|
||||
struct symtab_and_line sal = find_sal_for_pc (start, notcurrent);
|
||||
struct symtab_and_line best_sal = sal;
|
||||
|
||||
if (sal.pc == 0 || sal.line == 0 || sal.end == 0)
|
||||
@@ -180,7 +180,7 @@ find_last_line_symbol (CORE_ADDR start, CORE_ADDR end, int notcurrent)
|
||||
{
|
||||
if (sal.line && sal.line <= best_sal.line)
|
||||
best_sal = sal;
|
||||
sal = find_pc_line (sal.end, notcurrent);
|
||||
sal = find_sal_for_pc (sal.end, notcurrent);
|
||||
}
|
||||
while (sal.pc && sal.pc < end);
|
||||
|
||||
@@ -343,7 +343,7 @@ iq2000_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
|
||||
struct iq2000_frame_cache cache;
|
||||
|
||||
/* Found a function. */
|
||||
sal = find_pc_line (func_addr, 0);
|
||||
sal = find_sal_for_pc (func_addr, 0);
|
||||
if (sal.end && sal.end < func_end)
|
||||
/* Found a line number, use it as end of prologue. */
|
||||
return sal.end;
|
||||
|
||||
@@ -2161,7 +2161,7 @@ static std::vector<symtab_and_line>
|
||||
convert_address_location_to_sals (struct linespec_state *self,
|
||||
CORE_ADDR address)
|
||||
{
|
||||
symtab_and_line sal = find_pc_line (address, 0);
|
||||
symtab_and_line sal = find_sal_for_pc (address, 0);
|
||||
sal.pc = address;
|
||||
sal.section = find_pc_overlay (address);
|
||||
sal.explicit_pc = 1;
|
||||
|
||||
@@ -904,7 +904,7 @@ print_checkpoints (struct ui_out *uiout, inferior *req_inf, fork_info *req_fi)
|
||||
: fi.pc);
|
||||
uiout->field_core_addr ("addr", get_current_arch (), pc);
|
||||
|
||||
symtab_and_line sal = find_pc_line (pc, 0);
|
||||
symtab_and_line sal = find_sal_for_pc (pc, 0);
|
||||
if (sal.symtab)
|
||||
{
|
||||
uiout->text (", file ");
|
||||
|
||||
@@ -595,7 +595,7 @@ loongarch_analyze_prologue (const frame_info_ptr &this_frame,
|
||||
if (find_pc_partial_function (block_addr, NULL, &prologue_start,
|
||||
&prologue_end))
|
||||
{
|
||||
struct symtab_and_line sal = find_pc_line (prologue_start, 0);
|
||||
struct symtab_and_line sal = find_sal_for_pc (prologue_start, 0);
|
||||
|
||||
if (sal.line == 0)
|
||||
{
|
||||
|
||||
@@ -463,7 +463,7 @@ m32r_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
|
||||
|
||||
if (find_pc_partial_function (pc, NULL, &func_addr, &func_end))
|
||||
{
|
||||
sal = find_pc_line (func_addr, 0);
|
||||
sal = find_sal_for_pc (func_addr, 0);
|
||||
|
||||
if (sal.line != 0 && sal.end <= func_end)
|
||||
{
|
||||
|
||||
@@ -758,7 +758,7 @@ m68hc11_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
|
||||
first source line. */
|
||||
if (find_pc_partial_function (pc, NULL, &func_addr, &func_end))
|
||||
{
|
||||
sal = find_pc_line (func_addr, 0);
|
||||
sal = find_sal_for_pc (func_addr, 0);
|
||||
if (sal.end && sal.end < func_end)
|
||||
return sal.end;
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ default_macro_scope ()
|
||||
/* If there's a selected frame, use its PC. */
|
||||
frame = deprecated_safe_get_selected_frame ();
|
||||
if (frame && (pc = get_frame_pc_if_available (frame)))
|
||||
sal = find_pc_line (*pc, 0);
|
||||
sal = find_sal_for_pc (*pc, 0);
|
||||
|
||||
/* Fall back to the current listing position. */
|
||||
else
|
||||
|
||||
@@ -399,7 +399,7 @@ microblaze_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR start_pc)
|
||||
Always analyze the prologue. */
|
||||
if (find_pc_partial_function (start_pc, NULL, &func_start, &func_end))
|
||||
{
|
||||
sal = find_pc_line (func_start, 0);
|
||||
sal = find_sal_for_pc (func_start, 0);
|
||||
|
||||
if (sal.end < func_end
|
||||
&& start_pc <= sal.end)
|
||||
|
||||
@@ -232,7 +232,7 @@ moxie_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
|
||||
files. */
|
||||
if (sym && sym->language () != language_asm)
|
||||
{
|
||||
sal = find_pc_line (func_addr, 0);
|
||||
sal = find_sal_for_pc (func_addr, 0);
|
||||
if (sal.end && sal.end < func_end)
|
||||
{
|
||||
/* Found a line number, use it as end of
|
||||
|
||||
@@ -112,7 +112,7 @@ using_direct::valid_line (unsigned int boundary) const
|
||||
try
|
||||
{
|
||||
CORE_ADDR curr_pc = get_frame_pc (get_selected_frame (nullptr));
|
||||
symtab_and_line curr_sal = find_pc_line (curr_pc, 0);
|
||||
symtab_and_line curr_sal = find_sal_for_pc (curr_pc, 0);
|
||||
return (decl_line <= curr_sal.line)
|
||||
|| (decl_line >= boundary);
|
||||
}
|
||||
|
||||
@@ -467,7 +467,7 @@ or1k_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
|
||||
|
||||
if (0 != prologue_end)
|
||||
{
|
||||
struct symtab_and_line prologue_sal = find_pc_line (start_pc, 0);
|
||||
struct symtab_and_line prologue_sal = find_sal_for_pc (start_pc, 0);
|
||||
struct compunit_symtab *compunit
|
||||
= prologue_sal.symtab->compunit ();
|
||||
const char *debug_format = compunit->debugformat ();
|
||||
|
||||
@@ -559,7 +559,7 @@ pspy_find_pc_line (PyObject *o, PyObject *args)
|
||||
|
||||
set_current_program_space (self->pspace);
|
||||
|
||||
sal = find_pc_line (pc, 0);
|
||||
sal = find_sal_for_pc (pc, 0);
|
||||
result = symtab_and_line_to_sal_object (sal);
|
||||
}
|
||||
catch (const gdb_exception &except)
|
||||
|
||||
@@ -213,7 +213,7 @@ recpy_bt_insn_sal (PyObject *self, void *closure)
|
||||
|
||||
try
|
||||
{
|
||||
result = symtab_and_line_to_sal_object (find_pc_line (insn->pc, 0));
|
||||
result = symtab_and_line_to_sal_object (find_sal_for_pc (insn->pc, 0));
|
||||
}
|
||||
catch (const gdb_exception &except)
|
||||
{
|
||||
|
||||
@@ -1093,7 +1093,7 @@ btrace_compute_src_line_range (const struct btrace_function *bfun,
|
||||
{
|
||||
struct symtab_and_line sal;
|
||||
|
||||
sal = find_pc_line (insn.pc, 0);
|
||||
sal = find_sal_for_pc (insn.pc, 0);
|
||||
if (sal.symtab != symtab || sal.line == 0)
|
||||
continue;
|
||||
|
||||
|
||||
@@ -125,7 +125,7 @@ save_bookmark_command (const char *args, int from_tty)
|
||||
bookmark &b = all_bookmarks.emplace_back ();
|
||||
b.number = ++bookmark_count;
|
||||
b.pc = regcache_read_pc (regcache);
|
||||
b.sal = find_pc_line (b.pc, 0);
|
||||
b.sal = find_sal_for_pc (b.pc, 0);
|
||||
b.sal.pspace = get_frame_program_space (get_current_frame ());
|
||||
b.opaque_data.reset (bookmark_id);
|
||||
|
||||
|
||||
@@ -1827,8 +1827,8 @@ skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR lim_pc,
|
||||
associated with the prologue. */
|
||||
if ((pc - orig_pc) > 8)
|
||||
{
|
||||
struct symtab_and_line prologue_sal = find_pc_line (orig_pc, 0);
|
||||
struct symtab_and_line this_sal = find_pc_line (pc, 0);
|
||||
struct symtab_and_line prologue_sal = find_sal_for_pc (orig_pc, 0);
|
||||
struct symtab_and_line this_sal = find_sal_for_pc (pc, 0);
|
||||
|
||||
if ((prologue_sal.line == 0)
|
||||
|| (prologue_sal.line != this_sal.line))
|
||||
|
||||
@@ -1048,7 +1048,7 @@ sparc64_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR start_pc)
|
||||
using the debugging information. */
|
||||
if (find_pc_partial_function (start_pc, NULL, &func_start, &func_end))
|
||||
{
|
||||
sal = find_pc_line (func_start, 0);
|
||||
sal = find_sal_for_pc (func_start, 0);
|
||||
|
||||
if (sal.end < func_end
|
||||
&& start_pc <= sal.end)
|
||||
|
||||
28
gdb/symtab.c
28
gdb/symtab.c
@@ -3020,7 +3020,7 @@ find_pc_sect_line (CORE_ADDR pc, struct obj_section *section, int notcurrent)
|
||||
internal_error (_("Infinite recursion detected in find_pc_sect_line;"
|
||||
"please file a bug report"));
|
||||
|
||||
return find_pc_line (mfunsym.value_address (), 0);
|
||||
return find_sal_for_pc (mfunsym.value_address (), 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3175,7 +3175,7 @@ find_pc_sect_line (CORE_ADDR pc, struct obj_section *section, int notcurrent)
|
||||
/* Backward compatibility (no section). */
|
||||
|
||||
struct symtab_and_line
|
||||
find_pc_line (CORE_ADDR pc, int notcurrent)
|
||||
find_sal_for_pc (CORE_ADDR pc, int notcurrent)
|
||||
{
|
||||
struct obj_section *section;
|
||||
|
||||
@@ -3213,12 +3213,12 @@ sal_line_symtab_matches_p (const symtab_and_line &sal1,
|
||||
std::optional<CORE_ADDR>
|
||||
find_line_range_start (CORE_ADDR pc)
|
||||
{
|
||||
struct symtab_and_line current_sal = find_pc_line (pc, 0);
|
||||
struct symtab_and_line current_sal = find_sal_for_pc (pc, 0);
|
||||
|
||||
if (current_sal.line == 0)
|
||||
return {};
|
||||
|
||||
struct symtab_and_line prev_sal = find_pc_line (current_sal.pc - 1, 0);
|
||||
struct symtab_and_line prev_sal = find_sal_for_pc (current_sal.pc - 1, 0);
|
||||
|
||||
/* If the previous entry is for a different line, that means we are already
|
||||
at the entry with the start PC for this line. */
|
||||
@@ -3233,7 +3233,7 @@ find_line_range_start (CORE_ADDR pc)
|
||||
{
|
||||
prev_pc = prev_sal.pc;
|
||||
|
||||
prev_sal = find_pc_line (prev_pc - 1, 0);
|
||||
prev_sal = find_sal_for_pc (prev_pc - 1, 0);
|
||||
|
||||
/* Did we notice a line change? If so, we are done searching. */
|
||||
if (!sal_line_symtab_matches_p (prev_sal, current_sal))
|
||||
@@ -3250,9 +3250,9 @@ find_pc_line_symtab (CORE_ADDR pc)
|
||||
{
|
||||
struct symtab_and_line sal;
|
||||
|
||||
/* This always passes zero for NOTCURRENT to find_pc_line.
|
||||
/* This always passes zero for NOTCURRENT to find_sal_for_pc.
|
||||
There are currently no callers that ever pass non-zero. */
|
||||
sal = find_pc_line (pc, 0);
|
||||
sal = find_sal_for_pc (pc, 0);
|
||||
return sal.symtab;
|
||||
}
|
||||
|
||||
@@ -3509,7 +3509,7 @@ find_line_pc_range_for_pc (CORE_ADDR pc, CORE_ADDR *startptr, CORE_ADDR *endptr)
|
||||
{
|
||||
struct symtab_and_line sal;
|
||||
|
||||
sal = find_pc_line (pc, 0);
|
||||
sal = find_sal_for_pc (pc, 0);
|
||||
*startptr = sal.pc;
|
||||
*endptr = sal.end;
|
||||
return sal.symtab != 0;
|
||||
@@ -3642,7 +3642,7 @@ skip_prologue_using_linetable (CORE_ADDR func_addr)
|
||||
if (!find_pc_partial_function (func_addr, nullptr, &start_pc, &end_pc))
|
||||
return {};
|
||||
|
||||
const struct symtab_and_line prologue_sal = find_pc_line (start_pc, 0);
|
||||
const struct symtab_and_line prologue_sal = find_sal_for_pc (start_pc, 0);
|
||||
if (prologue_sal.symtab != nullptr
|
||||
&& prologue_sal.symtab->language () != language_asm)
|
||||
{
|
||||
@@ -3888,7 +3888,7 @@ skip_prologue_using_sal (struct gdbarch *gdbarch, CORE_ADDR func_addr)
|
||||
find_pc_partial_function (func_addr, NULL, &start_pc, &end_pc);
|
||||
start_pc += gdbarch_deprecated_function_start_offset (gdbarch);
|
||||
|
||||
prologue_sal = find_pc_line (start_pc, 0);
|
||||
prologue_sal = find_sal_for_pc (start_pc, 0);
|
||||
if (prologue_sal.line != 0)
|
||||
{
|
||||
/* For languages other than assembly, treat two consecutive line
|
||||
@@ -3927,7 +3927,7 @@ skip_prologue_using_sal (struct gdbarch *gdbarch, CORE_ADDR func_addr)
|
||||
{
|
||||
struct symtab_and_line sal;
|
||||
|
||||
sal = find_pc_line (prologue_sal.end, 0);
|
||||
sal = find_sal_for_pc (prologue_sal.end, 0);
|
||||
if (sal.line == 0)
|
||||
break;
|
||||
/* Assume that a consecutive SAL for the same (or larger)
|
||||
@@ -3994,10 +3994,10 @@ find_epilogue_using_linetable (CORE_ADDR func_addr)
|
||||
The lines of a function can be described by several line tables in case
|
||||
there are different files involved. There's a corner case where a
|
||||
function epilogue is in a different file than a function start, and using
|
||||
start_pc as argument to find_pc_line will mean we won't find the
|
||||
start_pc as argument to find_sal_for_pc will mean we won't find the
|
||||
epilogue. Instead, use "end_pc - 1" to maximize our chances of picking
|
||||
the line table containing an epilogue. */
|
||||
const struct symtab_and_line sal = find_pc_line (end_pc - 1, 0);
|
||||
const struct symtab_and_line sal = find_sal_for_pc (end_pc - 1, 0);
|
||||
if (sal.symtab != nullptr && sal.symtab->language () != language_asm)
|
||||
{
|
||||
struct objfile *objfile = sal.symtab->compunit ()->objfile ();
|
||||
@@ -4032,7 +4032,7 @@ find_epilogue_using_linetable (CORE_ADDR func_addr)
|
||||
This can happen when the linetable doesn't describe the full
|
||||
extent of the function. This can be triggered with:
|
||||
- compiler-generated debug info, in the cornercase that the pc
|
||||
with which we call find_pc_line resides in a different file
|
||||
with which we call find_sal_for_pc resides in a different file
|
||||
than unrel_end, or
|
||||
- invalid dwarf assembly debug info.
|
||||
In the former case, there's no point in iterating further, simply
|
||||
|
||||
@@ -2405,7 +2405,7 @@ struct symtab_and_line
|
||||
/* Given a pc value, return line number it is in. Second arg nonzero means
|
||||
if pc is on the boundary use the previous statement's line number. */
|
||||
|
||||
extern struct symtab_and_line find_pc_line (CORE_ADDR, int);
|
||||
extern struct symtab_and_line find_sal_for_pc (CORE_ADDR, int);
|
||||
|
||||
/* Same function, but specify a section as well as an address. */
|
||||
|
||||
@@ -2428,7 +2428,7 @@ extern struct symtab_and_line find_pc_sect_line (CORE_ADDR,
|
||||
|
||||
extern std::optional<CORE_ADDR> find_line_range_start (CORE_ADDR pc);
|
||||
|
||||
/* Wrapper around find_pc_line to just return the symtab. */
|
||||
/* Wrapper around find_sal_for_pc to just return the symtab. */
|
||||
|
||||
extern struct symtab *find_pc_line_symtab (CORE_ADDR);
|
||||
|
||||
|
||||
@@ -216,7 +216,7 @@ set_traceframe_context (const frame_info_ptr &trace_frame)
|
||||
if (trace_frame != NULL
|
||||
&& (trace_pc = get_frame_pc_if_available (trace_frame)))
|
||||
{
|
||||
traceframe_sal = find_pc_line (*trace_pc, 0);
|
||||
traceframe_sal = find_sal_for_pc (*trace_pc, 0);
|
||||
traceframe_fun = find_symbol_for_pc (*trace_pc);
|
||||
|
||||
/* Save linenumber as "$trace_line", a debugger variable visible to
|
||||
@@ -2334,7 +2334,7 @@ tfind_line_command (const char *args, int from_tty)
|
||||
symtab_and_line sal;
|
||||
if (args == 0 || *args == 0)
|
||||
{
|
||||
sal = find_pc_line (get_frame_pc (get_current_frame ()), 0);
|
||||
sal = find_sal_for_pc (get_frame_pc (get_current_frame ()), 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2360,7 +2360,7 @@ tfind_line_command (const char *args, int from_tty)
|
||||
print_address (get_current_arch (), start_pc, gdb_stdout);
|
||||
gdb_stdout->wrap_here (2);
|
||||
gdb_printf (" but contains no code.\n");
|
||||
sal = find_pc_line (start_pc, 0);
|
||||
sal = find_sal_for_pc (start_pc, 0);
|
||||
if (sal.line > 0
|
||||
&& find_line_pc_range (sal, &start_pc, &end_pc)
|
||||
&& start_pc != end_pc)
|
||||
@@ -3617,7 +3617,7 @@ print_one_static_tracepoint_marker (int count,
|
||||
|
||||
uiout->field_core_addr ("addr", marker.gdbarch, marker.address);
|
||||
|
||||
sal = find_pc_line (marker.address, 0);
|
||||
sal = find_sal_for_pc (marker.address, 0);
|
||||
sym = find_symbol_for_pc_sect (marker.address, NULL);
|
||||
if (sym)
|
||||
{
|
||||
|
||||
@@ -182,7 +182,7 @@ tui_source_window_base::update_source_window_with_addr (struct gdbarch *gdbarch,
|
||||
{
|
||||
struct symtab_and_line sal {};
|
||||
if (addr != 0)
|
||||
sal = find_pc_line (addr, 0);
|
||||
sal = find_sal_for_pc (addr, 0);
|
||||
|
||||
maybe_update (gdbarch, sal);
|
||||
}
|
||||
@@ -194,7 +194,7 @@ tui_update_source_windows_with_addr (struct gdbarch *gdbarch, CORE_ADDR addr)
|
||||
{
|
||||
struct symtab_and_line sal {};
|
||||
if (addr != 0)
|
||||
sal = find_pc_line (addr, 0);
|
||||
sal = find_sal_for_pc (addr, 0);
|
||||
|
||||
for (struct tui_source_window_base *win_info : tui_source_windows ())
|
||||
win_info->update_source_window (gdbarch, sal);
|
||||
@@ -493,7 +493,7 @@ tui_source_window_base::refill ()
|
||||
{
|
||||
frame_info_ptr fi = deprecated_safe_get_selected_frame ();
|
||||
if (fi != nullptr)
|
||||
sal = find_pc_line (get_frame_pc (fi), 0);
|
||||
sal = find_sal_for_pc (get_frame_pc (fi), 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -952,7 +952,7 @@ v850_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
|
||||
{
|
||||
struct symtab_and_line sal;
|
||||
|
||||
sal = find_pc_line (func_addr, 0);
|
||||
sal = find_sal_for_pc (func_addr, 0);
|
||||
if (sal.line != 0 && sal.end < func_end)
|
||||
return sal.end;
|
||||
|
||||
|
||||
@@ -428,7 +428,7 @@ xstormy16_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
|
||||
/* Don't use line number debug info for assembly source files. */
|
||||
if (sym && sym->language () != language_asm)
|
||||
{
|
||||
sal = find_pc_line (func_addr, 0);
|
||||
sal = find_sal_for_pc (func_addr, 0);
|
||||
if (sal.end && sal.end < func_end)
|
||||
{
|
||||
/* Found a line number, use it as end of prologue. */
|
||||
|
||||
@@ -2378,7 +2378,7 @@ call0_analyze_prologue (struct gdbarch *gdbarch,
|
||||
end_pc = 0;
|
||||
|
||||
/* Find out, if we have an information about the prologue from DWARF. */
|
||||
prologue_sal = find_pc_line (start, 0);
|
||||
prologue_sal = find_sal_for_pc (start, 0);
|
||||
if (prologue_sal.line != 0) /* Found debug info. */
|
||||
body_pc = prologue_sal.end;
|
||||
|
||||
@@ -3000,7 +3000,7 @@ xtensa_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR start_pc)
|
||||
|
||||
/* Try to find first body line from debug info. */
|
||||
|
||||
prologue_sal = find_pc_line (start_pc, 0);
|
||||
prologue_sal = find_sal_for_pc (start_pc, 0);
|
||||
if (prologue_sal.line != 0) /* Found debug info. */
|
||||
{
|
||||
/* In Call0, it is possible to have a function with only one instruction
|
||||
|
||||
@@ -494,7 +494,7 @@ z80_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
|
||||
|
||||
if (prologue_end != 0)
|
||||
{
|
||||
struct symtab_and_line prologue_sal = find_pc_line (func_addr, 0);
|
||||
struct symtab_and_line prologue_sal = find_sal_for_pc (func_addr, 0);
|
||||
struct compunit_symtab *compunit = prologue_sal.symtab->compunit ();
|
||||
const char *debug_format = compunit->debugformat ();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user