diff options
author | Tom Tromey <tom@tromey.com> | 2023-12-17 09:28:06 -0700 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2024-02-08 12:15:39 -0700 |
commit | 76139810361c0d46d6c49f5cfd5b4897538d1ac6 (patch) | |
tree | c9bd385c71c7e2dbfd45293f404a973809662259 /gdb/tui/tui-regs.c | |
parent | 6b32381343157132e2089ba13d50524b59da106e (diff) | |
download | binutils-76139810361c0d46d6c49f5cfd5b4897538d1ac6.zip binutils-76139810361c0d46d6c49f5cfd5b4897538d1ac6.tar.gz binutils-76139810361c0d46d6c49f5cfd5b4897538d1ac6.tar.bz2 |
Change tui_register_info::visible to a method
tui_register_info::visible is redundant with the fact that y==0 means
that the register is not visible. This patch changes this member in
favor of having a single indication of the register's visibility -- a
method with the same name. This change makes it clear that
delete_data_content_windows is not needed, so this is removed as well.
Approved-By: Andrew Burgess <aburgess@redhat.com>
Diffstat (limited to 'gdb/tui/tui-regs.c')
-rw-r--r-- | gdb/tui/tui-regs.c | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/gdb/tui/tui-regs.c b/gdb/tui/tui-regs.c index bacb23a..1230155 100644 --- a/gdb/tui/tui-regs.c +++ b/gdb/tui/tui-regs.c @@ -268,7 +268,6 @@ tui_data_window::display_registers_from (int start_element_no) /* Create the window if necessary. */ m_regs_content[i].x = box_width () + (m_item_width * j); m_regs_content[i].y = cur_y; - m_regs_content[i].visible = true; m_regs_content[i].rerender (handle.get (), m_item_width); i++; /* Next register. */ } @@ -346,23 +345,13 @@ tui_data_window::first_data_item_displayed () { for (int i = 0; i < m_regs_content.size (); i++) { - if (m_regs_content[i].visible) + if (m_regs_content[i].visible ()) return i; } return -1; } -/* See tui-regs.h. */ - -void -tui_data_window::delete_data_content_windows () -{ - for (auto &win : m_regs_content) - win.visible = false; -} - - void tui_data_window::erase_data_content (const char *prompt) { @@ -400,7 +389,6 @@ tui_data_window::rerender (bool toplevel) else { erase_data_content (NULL); - delete_data_content_windows (); display_registers_from (0); } } @@ -425,7 +413,6 @@ tui_data_window::do_scroll_vertical (int num_to_scroll) { first_line += num_to_scroll; erase_data_content (NULL); - delete_data_content_windows (); display_registers_from_line (first_line); } } @@ -448,7 +435,7 @@ tui_data_window::check_register_values (frame_info_ptr frame) /* 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.visible ()) data_item_win.rerender (handle.get (), m_item_width); } } |