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.
This commit is contained in:
Hannes Domani 2021-01-05 17:29:02 +01:00
parent 3537bc23d9
commit 4cf28e918a
2 changed files with 19 additions and 2 deletions

View File

@ -1,3 +1,10 @@
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.
2021-02-07 Hannes Domani <ssbssa@yahoo.de>
* tui/tui-regs.c (tui_data_item_window::rerender): Don't call

View File

@ -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);
}
}