Patchwork [6/6] Don't call erase_data_content from tui_data_window::show_registers

login
register
mail settings
Submitter Tom Tromey
Date Oct. 2, 2019, 11:12 p.m.
Message ID <20191002231202.10940-7-tom@tromey.com>
Download mbox | patch
Permalink /patch/34805/
State New
Headers show

Comments

Tom Tromey - Oct. 2, 2019, 11:12 p.m.
tui_data_window::show_registers currently calls erase_data_content.
However, I think it's better to have fewer calls to this (ideally just
one would suffice).  This refactors that function to remove this call.

gdb/ChangeLog
2019-10-02  Tom Tromey  <tom@tromey.com>

	* tui/tui-regs.c (tui_data_window::show_registers): Don't call
	erase_data_content.
---
 gdb/ChangeLog      | 5 +++++
 gdb/tui/tui-regs.c | 5 +++--
 2 files changed, 8 insertions(+), 2 deletions(-)

Patch

diff --git a/gdb/tui/tui-regs.c b/gdb/tui/tui-regs.c
index 474b62e2047..1d936f712b6 100644
--- a/gdb/tui/tui-regs.c
+++ b/gdb/tui/tui-regs.c
@@ -154,13 +154,14 @@  tui_data_window::show_registers (struct reggroup *group)
       for (auto &&data_item_win : m_regs_content)
 	data_item_win.highlight = false;
       m_current_group = group;
-      rerender ();
     }
   else
     {
       m_current_group = 0;
-      erase_data_content (_("[ Register Values Unavailable ]"));
+      m_regs_content.clear ();
     }
+
+  rerender ();
 }