diff options
author | Hannes Domani <ssbssa@yahoo.de> | 2021-01-05 17:29:02 +0100 |
---|---|---|
committer | Hannes Domani <ssbssa@yahoo.de> | 2021-02-07 19:13:45 +0100 |
commit | 4cf28e918accb76e8f343eee40c4955b4969f335 (patch) | |
tree | 54f64416934b44a48470c9d39047658bbaee5b22 /gdb/tui | |
parent | 3537bc23d960f961d66d36919049c0cc095c8a9c (diff) | |
download | binutils-4cf28e918accb76e8f343eee40c4955b4969f335.zip binutils-4cf28e918accb76e8f343eee40c4955b4969f335.tar.gz binutils-4cf28e918accb76e8f343eee40c4955b4969f335.tar.bz2 |
Don't draw register sub windows outside the visible area
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-02-07 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.
Diffstat (limited to 'gdb/tui')
-rw-r--r-- | gdb/tui/tui-regs.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/gdb/tui/tui-regs.c b/gdb/tui/tui-regs.c index 5caff71..a938736 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); } } |