Patchwork [17/19] Remove tui_clear_exec_info_content

login
register
mail settings
Submitter Tom Tromey
Date Aug. 3, 2019, 1:29 p.m.
Message ID <20190803132925.25074-18-tom@tromey.com>
Download mbox | patch
Permalink /patch/33942/
State New
Headers show

Comments

Tom Tromey - Aug. 3, 2019, 1:29 p.m.
After the previous patch, all calls to tui_clear_exec_info_content
come just after a call to tui_clear_source_content.  Because these two
windows are linked, I think it makes sense to have
tui_clear_source_content simply do the work.  So, this patch removes
tui_clear_exec_info_content.

gdb/ChangeLog
2019-08-03  Tom Tromey  <tom@tromey.com>

	* tui/tui-winsource.h (tui_clear_exec_info_content): Don't
	declare.
	* tui/tui-winsource.c (tui_update_source_window_as_is)
	(tui_update_source_windows_with_addr, tui_erase_source_content):
	Update.
	(tui_clear_exec_info_content): Remove.
---
 gdb/ChangeLog           |  9 +++++++++
 gdb/tui/tui-winsource.c | 24 +++++++-----------------
 gdb/tui/tui-winsource.h |  1 -
 3 files changed, 16 insertions(+), 18 deletions(-)

Patch

diff --git a/gdb/tui/tui-winsource.c b/gdb/tui/tui-winsource.c
index ed2af064c47..2f02c6a0120 100644
--- a/gdb/tui/tui-winsource.c
+++ b/gdb/tui/tui-winsource.c
@@ -98,10 +98,7 @@  tui_update_source_window_as_is (struct tui_source_window_base *win_info,
     ret = tui_set_disassem_content (win_info, gdbarch, line_or_addr.u.addr);
 
   if (ret == TUI_FAILURE)
-    {
-      tui_clear_source_content (win_info);
-      tui_clear_exec_info_content (win_info);
-    }
+    tui_clear_source_content (win_info);
   else
     {
       tui_update_breakpoint_info (win_info, nullptr, false);
@@ -156,10 +153,7 @@  tui_update_source_windows_with_addr (struct gdbarch *gdbarch, CORE_ADDR addr)
   else
     {
       for (struct tui_source_window_base *win_info : tui_source_windows ())
-	{
-	  tui_clear_source_content (win_info);
-	  tui_clear_exec_info_content (win_info);
-	}
+	tui_clear_source_content (win_info);
     }
 }
 
@@ -244,6 +238,11 @@  tui_erase_source_content (struct tui_source_window_base *win_info)
 
       win_info->content.clear ();
       win_info->refresh_window ();
+
+      struct tui_gen_win_info *exec_info = win_info->execution_info;
+
+      werase (exec_info->handle);
+      exec_info->refresh_window ();
     }
 }
 
@@ -655,15 +654,6 @@  tui_source_window_base::show_exec_info_content ()
 }
 
 
-void
-tui_clear_exec_info_content (struct tui_source_window_base *win_info)
-{
-  struct tui_gen_win_info *exec_info = win_info->execution_info;
-
-  werase (exec_info->handle);
-  exec_info->refresh_window ();
-}
-
 /* Function to update the execution info window.  */
 void
 tui_source_window_base::update_exec_info ()
diff --git a/gdb/tui/tui-winsource.h b/gdb/tui/tui-winsource.h
index d8a84b01846..e0a96c14dcc 100644
--- a/gdb/tui/tui-winsource.h
+++ b/gdb/tui/tui-winsource.h
@@ -188,7 +188,6 @@  extern void tui_update_source_windows_with_line (struct symtab *,
 						 int);
 extern void tui_clear_source_content (struct tui_source_window_base *);
 extern void tui_erase_source_content (struct tui_source_window_base *);
-extern void tui_clear_exec_info_content (struct tui_source_window_base *);
 
 extern void tui_alloc_source_buffer (struct tui_source_window_base *);
 extern int tui_line_is_displayed (int,