]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Move scrollok call in register window
authorTom Tromey <tom@tromey.com>
Sun, 17 Dec 2023 16:31:05 +0000 (09:31 -0700)
committerTom Tromey <tom@tromey.com>
Thu, 8 Feb 2024 19:15:39 +0000 (12:15 -0700)
The register window calls scrollok each time a register is written to
the window.  However, we only need to call this once, at the start of
display.  (We could actually call it just once when the window is
made, but that would involve making another method virtual or adding a
new member -- both which I think are worse than this approach.)

Tested-By: Tom de Vries <tdevries@suse.de>
Reviewed-By: Andrew Burgess <aburgess@redhat.com>
Approved-By: Andrew Burgess <aburgess@redhat.com>
gdb/tui/tui-regs.c

index 12301552c341a01976ce0207c8c76b1061f0f76b..eeea03f87c138da689b2855ef659300a0e7bc1d0 100644 (file)
@@ -236,6 +236,10 @@ tui_data_window::update_register_data (const reggroup *group,
 void
 tui_data_window::display_registers_from (int start_element_no)
 {
+  /* In case the regs window is not boxed, we'll write the last char in the
+     last line here, causing a scroll, so prevent that.  */
+  scrollok (handle.get (), FALSE);
+
   int max_len = 0;
   for (auto &&data_item_win : m_regs_content)
     {
@@ -448,10 +452,6 @@ tui_data_window::check_register_values (frame_info_ptr frame)
 void
 tui_register_info::rerender (WINDOW *handle, int field_width)
 {
-  /* In case the regs window is not boxed, we'll write the last char in the
-     last line here, causing a scroll, so prevent that.  */
-  scrollok (handle, FALSE);
-
   if (highlight)
     /* We ignore the return value, casting it to void in order to avoid
        a compiler warning.  The warning itself was introduced by a patch