diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c index 500ac77d75a..89142e0a214 100644 --- a/gdb/aarch64-tdep.c +++ b/gdb/aarch64-tdep.c @@ -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) { diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c index 59e01620ae6..654cef2c2f2 100644 --- a/gdb/alpha-tdep.c +++ b/gdb/alpha-tdep.c @@ -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; diff --git a/gdb/arc-tdep.c b/gdb/arc-tdep.c index f5ae11c4ecb..d7c908b1c6c 100644 --- a/gdb/arc-tdep.c +++ b/gdb/arc-tdep.c @@ -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. */ diff --git a/gdb/arm-linux-tdep.c b/gdb/arm-linux-tdep.c index ff20ed88d46..200ba9d35af 100644 --- a/gdb/arm-linux-tdep.c +++ b/gdb/arm-linux-tdep.c @@ -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; diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index b03e67b1aa8..ad708e9bd45 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -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; diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index de98a2327d7..a2c326b9f3f 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -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; diff --git a/gdb/c-exp.y b/gdb/c-exp.y index 11f0d88bfc0..9f1cb1b2e2a 100644 --- a/gdb/c-exp.y +++ b/gdb/c-exp.y @@ -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 ()) diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c index 1007af46cba..1eda034ff12 100644 --- a/gdb/cli/cli-cmds.c +++ b/gdb/cli/cli-cmds.c @@ -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 diff --git a/gdb/compile/compile-c-support.c b/gdb/compile/compile-c-support.c index ac8888fb16b..2ff1a9ff371 100644 --- a/gdb/compile/compile-c-support.c +++ b/gdb/compile/compile-c-support.c @@ -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 ()) diff --git a/gdb/cp-namespace.c b/gdb/cp-namespace.c index 009ea4b4c96..caece67d0bf 100644 --- a/gdb/cp-namespace.c +++ b/gdb/cp-namespace.c @@ -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 diff --git a/gdb/cris-tdep.c b/gdb/cris-tdep.c index 9cfc1ebd6fb..5c04c7cb8cc 100644 --- a/gdb/cris-tdep.c +++ b/gdb/cris-tdep.c @@ -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; } diff --git a/gdb/disasm.c b/gdb/disasm.c index 73b094b1173..b2e795d5c69 100644 --- a/gdb/disasm.c +++ b/gdb/disasm.c @@ -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) { diff --git a/gdb/elfread.c b/gdb/elfread.c index 152576d3523..20c124cf14f 100644 --- a/gdb/elfread.c +++ b/gdb/elfread.c @@ -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; diff --git a/gdb/frame.c b/gdb/frame.c index 4162a35b753..b84e30c2390 100644 --- a/gdb/frame.c +++ b/gdb/frame.c @@ -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 diff --git a/gdb/frv-tdep.c b/gdb/frv-tdep.c index b2d6e1a1eab..9bd719cd2ff 100644 --- a/gdb/frv-tdep.c +++ b/gdb/frv-tdep.c @@ -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) { diff --git a/gdb/ft32-tdep.c b/gdb/ft32-tdep.c index 33849290bb0..860c9837032 100644 --- a/gdb/ft32-tdep.c +++ b/gdb/ft32-tdep.c @@ -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. */ diff --git a/gdb/guile/scm-symtab.c b/gdb/guile/scm-symtab.c index e337a4b5927..09887a41be0 100644 --- a/gdb/guile/scm-symtab.c +++ b/gdb/guile/scm-symtab.c @@ -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) { diff --git a/gdb/h8300-tdep.c b/gdb/h8300-tdep.c index 15b0002b8d2..b088b2a342c 100644 --- a/gdb/h8300-tdep.c +++ b/gdb/h8300-tdep.c @@ -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; diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c index acd002863b3..230e9beba39 100644 --- a/gdb/hppa-tdep.c +++ b/gdb/hppa-tdep.c @@ -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 diff --git a/gdb/ia64-tdep.c b/gdb/ia64-tdep.c index 370973a652f..a626cb22fbd 100644 --- a/gdb/ia64-tdep.c +++ b/gdb/ia64-tdep.c @@ -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 diff --git a/gdb/infcmd.c b/gdb/infcmd.c index 285086ebb1c..4e9bdda5a6d 100644 --- a/gdb/infcmd.c +++ b/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, diff --git a/gdb/infrun.c b/gdb/infrun.c index 959393d3e5e..84c1545f06b 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -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 ()) diff --git a/gdb/iq2000-tdep.c b/gdb/iq2000-tdep.c index 58a4dfbdb83..782f8b729c8 100644 --- a/gdb/iq2000-tdep.c +++ b/gdb/iq2000-tdep.c @@ -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; diff --git a/gdb/linespec.c b/gdb/linespec.c index b6fe4e170bf..05f676ee38d 100644 --- a/gdb/linespec.c +++ b/gdb/linespec.c @@ -2161,7 +2161,7 @@ static std::vector 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; diff --git a/gdb/linux-fork.c b/gdb/linux-fork.c index 48732b70ec3..9e8e1a1f6a9 100644 --- a/gdb/linux-fork.c +++ b/gdb/linux-fork.c @@ -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 "); diff --git a/gdb/loongarch-tdep.c b/gdb/loongarch-tdep.c index e94b88bc010..5e09125e400 100644 --- a/gdb/loongarch-tdep.c +++ b/gdb/loongarch-tdep.c @@ -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) { diff --git a/gdb/m32r-tdep.c b/gdb/m32r-tdep.c index 4ac08fdd6c8..ae233a1e94d 100644 --- a/gdb/m32r-tdep.c +++ b/gdb/m32r-tdep.c @@ -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) { diff --git a/gdb/m68hc11-tdep.c b/gdb/m68hc11-tdep.c index 5389fee9ffd..a61a49e43bb 100644 --- a/gdb/m68hc11-tdep.c +++ b/gdb/m68hc11-tdep.c @@ -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; } diff --git a/gdb/macroscope.c b/gdb/macroscope.c index a8b78c9906c..563ef9931b3 100644 --- a/gdb/macroscope.c +++ b/gdb/macroscope.c @@ -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 diff --git a/gdb/microblaze-tdep.c b/gdb/microblaze-tdep.c index 404e4cde2ad..3953a96a4e1 100644 --- a/gdb/microblaze-tdep.c +++ b/gdb/microblaze-tdep.c @@ -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) diff --git a/gdb/moxie-tdep.c b/gdb/moxie-tdep.c index bb4887799bd..7aa9b0536d5 100644 --- a/gdb/moxie-tdep.c +++ b/gdb/moxie-tdep.c @@ -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 diff --git a/gdb/namespace.c b/gdb/namespace.c index 52eb1eae375..ace85425131 100644 --- a/gdb/namespace.c +++ b/gdb/namespace.c @@ -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); } diff --git a/gdb/or1k-tdep.c b/gdb/or1k-tdep.c index 2db207dafdd..442bdaf9fab 100644 --- a/gdb/or1k-tdep.c +++ b/gdb/or1k-tdep.c @@ -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 (); diff --git a/gdb/python/py-progspace.c b/gdb/python/py-progspace.c index a0afc7b7dba..7ca9d88bbd2 100644 --- a/gdb/python/py-progspace.c +++ b/gdb/python/py-progspace.c @@ -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) diff --git a/gdb/python/py-record-btrace.c b/gdb/python/py-record-btrace.c index 620f033e679..7acf70ec83b 100644 --- a/gdb/python/py-record-btrace.c +++ b/gdb/python/py-record-btrace.c @@ -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) { diff --git a/gdb/record-btrace.c b/gdb/record-btrace.c index 51121817da1..cc9365d2fa1 100644 --- a/gdb/record-btrace.c +++ b/gdb/record-btrace.c @@ -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; diff --git a/gdb/reverse.c b/gdb/reverse.c index dc35bca70fa..376435deab2 100644 --- a/gdb/reverse.c +++ b/gdb/reverse.c @@ -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); diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c index 75079b9e211..7c8a6f70ef6 100644 --- a/gdb/rs6000-tdep.c +++ b/gdb/rs6000-tdep.c @@ -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)) diff --git a/gdb/sparc64-tdep.c b/gdb/sparc64-tdep.c index 68464212802..a16f5c4111a 100644 --- a/gdb/sparc64-tdep.c +++ b/gdb/sparc64-tdep.c @@ -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) diff --git a/gdb/symtab.c b/gdb/symtab.c index f3377ff2a7e..f36d5b26295 100644 --- a/gdb/symtab.c +++ b/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 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 diff --git a/gdb/symtab.h b/gdb/symtab.h index 1d419dd16e6..9f6a6c36122 100644 --- a/gdb/symtab.h +++ b/gdb/symtab.h @@ -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 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); diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c index ce5418b8791..c0db7c8e6fa 100644 --- a/gdb/tracepoint.c +++ b/gdb/tracepoint.c @@ -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) { diff --git a/gdb/tui/tui-winsource.c b/gdb/tui/tui-winsource.c index 2fe4914f270..e66c4596586 100644 --- a/gdb/tui/tui-winsource.c +++ b/gdb/tui/tui-winsource.c @@ -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); } } diff --git a/gdb/v850-tdep.c b/gdb/v850-tdep.c index d592344e2e3..0b77cf38d3f 100644 --- a/gdb/v850-tdep.c +++ b/gdb/v850-tdep.c @@ -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; diff --git a/gdb/xstormy16-tdep.c b/gdb/xstormy16-tdep.c index b63dfa04be0..64aa16f5a13 100644 --- a/gdb/xstormy16-tdep.c +++ b/gdb/xstormy16-tdep.c @@ -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. */ diff --git a/gdb/xtensa-tdep.c b/gdb/xtensa-tdep.c index 8a2f129c758..19bec106364 100644 --- a/gdb/xtensa-tdep.c +++ b/gdb/xtensa-tdep.c @@ -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 diff --git a/gdb/z80-tdep.c b/gdb/z80-tdep.c index 9ae8b7a5857..31d319392dd 100644 --- a/gdb/z80-tdep.c +++ b/gdb/z80-tdep.c @@ -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 ();