This is a refactor to setup for the next commit.
The maybe_update function currently takes a frame_info_ptr&, however,
it only uses this to get the frame's gdbarch.
In the next commit I want to call maybe_update when I have a gdbarch,
but no frame_info_ptr& (the inferior hasn't even started).
So, update maybe_update to take the gdbarch, and update the callers to
pass that through. Most callers already have the gdbarch to hand, but
in one place I do need to extract this from the frame_info_ptr&.
There should be no user visible changes after this commit.
Approved-By: Tom Tromey <tom@tromey.com>
}
void
-tui_disasm_window::maybe_update (const frame_info_ptr &fi, symtab_and_line sal)
+tui_disasm_window::maybe_update (struct gdbarch *gdbarch, symtab_and_line sal)
{
CORE_ADDR low;
- struct gdbarch *frame_arch = get_frame_arch (fi);
-
if (find_pc_partial_function (sal.pc, NULL, &low, NULL) == 0)
{
/* There is no symbol available for current PC. There is no
low = sal.pc;
}
else
- low = tui_get_low_disassembly_address (frame_arch, low, sal.pc);
+ low = tui_get_low_disassembly_address (gdbarch, low, sal.pc);
struct tui_line_or_address a;
if (!addr_is_displayed (sal.pc))
{
sal.pc = low;
- update_source_window (frame_arch, sal);
+ update_source_window (gdbarch, sal);
}
else
{
bool location_matches_p (struct bp_location *loc, int line_no) override;
- void maybe_update (const frame_info_ptr &fi, symtab_and_line sal) override;
+ void maybe_update (struct gdbarch *gdbarch, symtab_and_line sal) override;
void erase_source_content () override
{
}
void
-tui_source_window::maybe_update (const frame_info_ptr &fi, symtab_and_line sal)
+tui_source_window::maybe_update (struct gdbarch *gdbarch, symtab_and_line sal)
{
int start_line = (sal.line - ((height - box_size ()) / 2)) + 1;
if (start_line <= 0)
if (!(source_already_displayed && line_is_displayed (sal.line)))
{
sal.line = start_line;
- update_source_window (get_frame_arch (fi), sal);
+ update_source_window (gdbarch, sal);
}
else
{
bool showing_source_p (const char *filename) const;
- void maybe_update (const frame_info_ptr &fi, symtab_and_line sal) override;
+ void maybe_update (struct gdbarch *gdbarch, symtab_and_line sal) override;
void erase_source_content () override
{
else
func_name = _("<unavailable>");
+ struct gdbarch *gdbarch = get_frame_arch (fi);
status_changed_p
- = tui_location.set_location (get_frame_arch (fi), sal, func_name);
+ = tui_location.set_location (gdbarch, sal, func_name);
/* If the status information has not changed, then frame information has
not changed. If frame information has not changed, then the windows'
for (struct tui_source_window_base *win_info : tui_source_windows ())
{
- win_info->maybe_update (fi, sal);
+ win_info->maybe_update (gdbarch, sal);
win_info->update_exec_info ();
}
}
/* Update the window to display the given location. Does nothing if
the location is already displayed. */
- virtual void maybe_update (const frame_info_ptr &fi, symtab_and_line sal) = 0;
+ virtual void maybe_update (struct gdbarch *gdbarch, symtab_and_line sal) = 0;
void update_source_window_as_is (struct gdbarch *gdbarch,
const struct symtab_and_line &sal);