While working on the commit:
commit
4f28b020a3416ac87ac12cf7ae3625a4bc178975
Date: Wed Feb 5 20:12:03 2025 +0000
gdb/tui: use wrefresh if output is not surpressed
I spotted some places where tui_win_info::refresh_window() was being
called when suppress_output was false. This means that there is no
tui_batch_rendering in place on the call stack, and so, after that
commit, we might be performing more wrefresh() calls than necessary.
Before the above commit we would have been calling wnoutrefresh() and,
due to the missing tui_batch_rendering, there might have been a delay
before doupdate() was called.
To (hopefully) make screen updates smoother, this commit adds
tui_batch_rendering in a few places where it is possible that there
might be multiple window updates performed, this will mean the final
write to screen is deferred until the tui_batch_rendering goes out of
scope.
Other than possibly smother screen updates, there should be no user
visible changes after this commit.
Approved-By: Tom Tromey <tom@tromey.com>
#include "tui/tui-regs.h"
#include "tui/tui-status.h"
#include "tui/tui-winsource.h"
+#include "tui/tui-wingeneral.h"
static void
tui_new_objfile_hook (struct objfile* objfile)
target_terminal::scoped_restore_terminal_state term_state;
target_terminal::ours_for_output ();
+ tui_batch_rendering defer;
+
if (from_stack)
{
frame_info_ptr fi;
static void
tui_inferior_exit (struct inferior *inf)
{
+ tui_batch_rendering defer;
+
/* Leave the SingleKey mode to make sure the gdb prompt is visible. */
tui_set_key_mode (TUI_COMMAND_MODE);
tui_show_frame_info (0);
new_size = curr_size + input_no;
}
+ tui_batch_rendering defer;
+
/* Now change the window's height, and adjust
all other windows around it. */
if (set_width_p)
#include "tui/tui-source.h"
#include "tui/tui-disasm.h"
#include "tui/tui-location.h"
+#include "tui/tui-wingeneral.h"
#include "gdb_curses.h"
/* Function to display the "main" routine. */
tui_get_begin_asm_address (&gdbarch, &addr);
if (addr != (CORE_ADDR) 0)
{
- struct symtab *s;
+ tui_batch_rendering defer;
tui_update_source_windows_with_addr (gdbarch, addr);
- s = find_pc_line_symtab (addr);
+ struct symtab *s = find_pc_line_symtab (addr);
tui_location.set_location (s);
}
}
void
tui_update_all_breakpoint_info (struct breakpoint *being_deleted)
{
+ tui_batch_rendering defer;
+
for (tui_source_window_base *win : tui_source_windows ())
{
if (win->update_breakpoint_info (being_deleted, false))
if (tui_active)
return;
+ tui_batch_rendering defer;
+
/* To avoid to initialize curses when gdb starts, there is a deferred
curses initialization. This initialization is made only once
and the first time the curses mode is entered. */