+ for (lineno = 1; lineno <= content.size (); lineno++)
+ tui_show_source_line (this, lineno);
+ }
+ else
+ erase_source_content ();
+
+ check_and_display_highlight_if_needed ();
+ refresh_window ();
+}
+
+/* See tui-data.h. */
+
+void
+tui_source_window_base::clear_detail ()
+{
+ gdbarch = NULL;
+ start_line_or_addr.loa = LOA_ADDRESS;
+ start_line_or_addr.u.addr = 0;
+ horizontal_offset = 0;
+}
+
+tui_source_window_base::tui_source_window_base (enum tui_win_type type)
+ : tui_win_info (type),
+ execution_info (new tui_exec_info_window ())
+{
+ gdb_assert (type == SRC_WIN || type == DISASSEM_WIN);
+ start_line_or_addr.loa = LOA_ADDRESS;
+ start_line_or_addr.u.addr = 0;
+}
+
+
+tui_source_window_base::~tui_source_window_base ()
+{
+ xfree (fullname);
+ delete execution_info;
+}
+
+void
+tui_source_window_base::resize (int height, int width,
+ int origin_x, int origin_y)
+{
+ tui_gen_win_info::resize (height, width - 3,
+ origin_x + 3, origin_y);
+ execution_info->resize (height, 3, origin_x, origin_y);
+}
+
+/* See tui-data.h. */
+
+void
+tui_source_window_base::refresh_all ()
+{
+ show_source_content ();
+ check_and_display_highlight_if_needed ();
+ update_exec_info ();
+}
+
+/* See tui-data.h. */
+
+void
+tui_source_window_base::update_tab_width ()
+{
+ werase (handle);
+ rerender ();
+}
+
+void
+tui_source_window_base::rerender ()
+{
+ if (!content.empty ())
+ {
+ struct tui_line_or_address line_or_addr;
+ struct symtab_and_line cursal
+ = get_current_source_symtab_and_line ();
+
+ line_or_addr = start_line_or_addr;
+ tui_update_source_window (this, gdbarch,
+ cursal.symtab, line_or_addr);
+ }
+ else if (deprecated_safe_get_selected_frame () != NULL)
+ {
+ struct tui_line_or_address line;
+ struct symtab_and_line cursal
+ = get_current_source_symtab_and_line ();
+ struct frame_info *frame = deprecated_safe_get_selected_frame ();
+ struct gdbarch *gdbarch = get_frame_arch (frame);
+
+ struct symtab *s = find_pc_line_symtab (get_frame_pc (frame));
+ if (type == SRC_WIN)
+ {
+ line.loa = LOA_LINE;
+ line.u.line_no = cursal.line;
+ }
+ else
+ {
+ line.loa = LOA_ADDRESS;
+ find_line_pc (s, cursal.line, &line.u.addr);
+ }
+ tui_update_source_window (this, gdbarch, s, line);