tui_show_source_line (struct tui_win_info *win_info, int lineno)
{
struct tui_win_element *line;
+ int x;
line = win_info->generic.content[lineno - 1];
if (line->which_element.source.is_exec_point)
- wattron (win_info->generic.handle, A_STANDOUT);
+ tui_set_reverse_mode (win_info->generic.handle, true);
wmove (win_info->generic.handle, lineno, 1);
tui_puts (line->which_element.source.line,
win_info->generic.handle);
if (line->which_element.source.is_exec_point)
- wattroff (win_info->generic.handle, A_STANDOUT);
+ tui_set_reverse_mode (win_info->generic.handle, false);
/* Clear to end of line but stop before the border. */
- wclrtoeol (win_info->generic.handle);
+ x = getcurx (win_info->generic.handle);
+ while (x + 1 < win_info->generic.width)
+ {
+ waddch (win_info->generic.handle, ' ');
+ x = getcurx (win_info->generic.handle);
+ }
}
void
win_info->generic.content_in_use = TRUE;
}
+/* Refill the source window's source cache and update it. If WIN_INFO
+ is a disassembly window, then just update it. */
+
+void
+tui_refill_source_window (struct tui_win_info *win_info)
+{
+ symtab *s = nullptr;
+
+ if (win_info->generic.type == SRC_WIN)
+ {
+ symtab_and_line cursal = get_current_source_symtab_and_line ();
+ s = (cursal.symtab == NULL
+ ? find_pc_line_symtab (get_frame_pc (get_selected_frame (NULL)))
+ : cursal.symtab);
+ }
+
+ tui_update_source_window_as_is (win_info,
+ win_info->detail.source_info.gdbarch,
+ s,
+ win_info->generic.content[0]
+ ->which_element.source.line_or_addr,
+ FALSE);
+}
/* Scroll the source forward or backward horizontally. */
+
void
tui_horizontal_source_scroll (struct tui_win_info *win_info,
enum tui_scroll_direction direction,
{
if (win_info->generic.content != NULL)
{
- struct gdbarch *gdbarch = win_info->detail.source_info.gdbarch;
int offset;
- struct symtab *s = NULL;
-
- if (win_info->generic.type == SRC_WIN)
- {
- struct symtab_and_line cursal
- = get_current_source_symtab_and_line ();
-
- if (cursal.symtab == NULL)
- s = find_pc_line_symtab (get_frame_pc (get_selected_frame (NULL)));
- else
- s = cursal.symtab;
- }
if (direction == LEFT_SCROLL)
offset = win_info->detail.source_info.horizontal_offset
offset = 0;
}
win_info->detail.source_info.horizontal_offset = offset;
- tui_update_source_window_as_is (win_info, gdbarch, s,
- win_info->generic.content[0]
- ->which_element.source.line_or_addr,
- FALSE);
+ tui_refill_source_window (win_info);
}
-
- return;
}
i++;
}
if (changed)
- tui_refresh_win (&win_info->generic);
+ tui_refill_source_window (win_info);
}
/* Update the execution windows to show the active breakpoints.