+2019-12-20 Tom Tromey <tom@tromey.com>
+
+ * tui/tui-winsource.h (struct tui_source_window_base)
+ <maybe_update>: Remove line_no and addr parameters.
+ * tui/tui-stack.c (tui_show_frame_info): Set PC on sal. Update.
+ * tui/tui-source.h (struct tui_source_window) <maybe_update>:
+ Update.
+ * tui/tui-source.c (tui_source_window::maybe_update): Remove
+ line_no and addr parameters.
+ * tui/tui-disasm.h (struct tui_disasm_window) <maybe_update>:
+ Update.
+ * tui/tui-disasm.c (tui_disasm_window::maybe_update): Remove
+ line_no and addr parameters.
+
2019-12-20 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.c (tui_source_window_base::set_is_exec_point_at)
}
void
-tui_disasm_window::maybe_update (struct frame_info *fi, symtab_and_line sal,
- int line_no, CORE_ADDR addr)
+tui_disasm_window::maybe_update (struct frame_info *fi, symtab_and_line sal)
{
CORE_ADDR low;
- if (find_pc_partial_function (get_frame_pc (fi),
- NULL, &low, NULL) == 0)
+ 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
safe way how to "disassemble backwards". */
- low = get_frame_pc (fi);
+ low = sal.pc;
}
else
- low = tui_get_low_disassembly_address (get_frame_arch (fi),
- low, get_frame_pc (fi));
+ low = tui_get_low_disassembly_address (frame_arch, low, sal.pc);
struct tui_line_or_address a;
a.loa = LOA_ADDRESS;
a.u.addr = low;
- if (!addr_is_displayed (addr))
- update_source_window (get_frame_arch (fi), sal.symtab, a);
+ if (!addr_is_displayed (sal.pc))
+ update_source_window (frame_arch, sal.symtab, a);
else
{
- a.u.addr = addr;
+ a.u.addr = sal.pc;
set_is_exec_point_at (a);
}
}
bool location_matches_p (struct bp_location *loc, int line_no) override;
- void maybe_update (struct frame_info *fi, symtab_and_line sal,
- int line_no, CORE_ADDR addr)
- override;
+ void maybe_update (struct frame_info *fi, symtab_and_line sal) override;
void erase_source_content () override
{
}
void
-tui_source_window::maybe_update (struct frame_info *fi, symtab_and_line sal,
- int line_no, CORE_ADDR addr)
+tui_source_window::maybe_update (struct frame_info *fi, symtab_and_line sal)
{
- int start_line = (line_no - (viewport_height / 2)) + 1;
+ int start_line = (sal.line - (viewport_height / 2)) + 1;
if (start_line <= 0)
start_line = 1;
l.loa = LOA_LINE;
l.u.line_no = start_line;
- if (!(source_already_displayed
- && line_is_displayed (line_no)))
+ if (!(source_already_displayed && line_is_displayed (sal.line)))
update_source_window (get_frame_arch (fi), sal.symtab, l);
else
{
- l.u.line_no = line_no;
+ l.u.line_no = sal.line;
set_is_exec_point_at (l);
}
}
bool showing_source_p (const char *filename) const;
- void maybe_update (struct frame_info *fi, symtab_and_line sal,
- int line_no, CORE_ADDR addr)
- override;
+ void maybe_update (struct frame_info *fi, symtab_and_line sal) override;
void erase_source_content () override
{
if (!locator_changed_p)
return 0;
+ /* find_frame_sal does not always set PC, but we want to ensure
+ that it is available in the SAL. */
+ sal.pc = pc;
+
for (struct tui_source_window_base *win_info : tui_source_windows ())
{
- win_info->maybe_update (fi, sal, locator->line_no, locator->addr);
+ win_info->maybe_update (fi, 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 (struct frame_info *fi, symtab_and_line sal,
- int line_no, CORE_ADDR addr) = 0;
+ virtual void maybe_update (struct frame_info *fi, symtab_and_line sal) = 0;
void update_source_window_as_is (struct gdbarch *gdbarch,
struct symtab *s,