[PATCH 3/3] Don't draw register sub windows outside the visible area
Hannes Domani
ssbssa@yahoo.de
Tue Jan 5 16:30:26 GMT 2021
If the regs window is not big enough to show all registers, the
registers whose values changed are always drawn, even if they are not
in the currently visible area.
So this marks the invisible register sub windows with y=0, and skips
their rerender call in check_register_values.
gdb/ChangeLog:
2021-01-05 Hannes Domani <ssbssa@yahoo.de>
* tui/tui-regs.c (tui_data_window::display_registers_from):
Mark invisible register sub windows.
(tui_data_window::check_register_values): Ignore invisible
register sub windows.
---
gdb/tui/tui-regs.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/gdb/tui/tui-regs.c b/gdb/tui/tui-regs.c
index 5caff7195ef..a9387368bbe 100644
--- a/gdb/tui/tui-regs.c
+++ b/gdb/tui/tui-regs.c
@@ -281,7 +281,11 @@ tui_data_window::display_registers_from (int start_element_no)
max_len = len;
}
m_item_width = max_len + 1;
- int i = start_element_no;
+
+ int i;
+ /* Mark register windows above the visible area. */
+ for (i = 0; i < start_element_no; i++)
+ m_regs_content[i].y = 0;
m_regs_column_count = (width - 2) / m_item_width;
if (m_regs_column_count == 0)
@@ -307,6 +311,10 @@ tui_data_window::display_registers_from (int start_element_no)
cur_y++; /* Next row. */
}
+ /* Mark register windows below the visible area. */
+ for (; i < m_regs_content.size (); i++)
+ m_regs_content[i].y = 0;
+
refresh_window ();
}
@@ -470,7 +478,9 @@ tui_data_window::check_register_values (struct frame_info *frame)
data_item_win.regno,
&data_item_win.highlight);
- if (data_item_win.highlight || was_hilighted)
+ /* Register windows whose y == 0 are outside the visible area. */
+ if ((data_item_win.highlight || was_hilighted)
+ && data_item_win.y > 0)
data_item_win.rerender (handle.get (), m_item_width);
}
}
--
2.29.2
More information about the Gdb-patches
mailing list