Patchwork [15/19] Turn tui_show_exec_info_content into a method

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

Comments

Tom Tromey - Aug. 3, 2019, 1:29 p.m.
This changes tui_show_exec_info_content to be a method on
tui_source_window_base.  As it is only called by other methods on this
class, it can be private.

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

	* tui/tui-winsource.h (struct tui_source_window_base)
	<show_exec_info_content>: Declare.
	(tui_show_exec_info_content): Don't declare.
	* tui/tui-winsource.c
	(tui_source_window_base::show_exec_info_content): Rename from
	tui_show_exec_info_content.
	(tui_source_window_base::update_exec_info): Update.
---
 gdb/ChangeLog           | 10 ++++++++++
 gdb/tui/tui-winsource.c | 12 ++++++------
 gdb/tui/tui-winsource.h |  4 +++-
 3 files changed, 19 insertions(+), 7 deletions(-)

Patch

diff --git a/gdb/tui/tui-winsource.c b/gdb/tui/tui-winsource.c
index 53113bd785c..c99e207b011 100644
--- a/gdb/tui/tui-winsource.c
+++ b/gdb/tui/tui-winsource.c
@@ -641,17 +641,17 @@  tui_source_window_base::set_exec_info_content ()
 
 
 void
-tui_show_exec_info_content (struct tui_source_window_base *win_info)
+tui_source_window_base::show_exec_info_content ()
 {
-  struct tui_exec_info_window *exec_info = win_info->execution_info;
-  const tui_exec_info_content *content = exec_info->get_content ();
+  struct tui_exec_info_window *exec_info = execution_info;
+  const tui_exec_info_content *exec_content = exec_info->get_content ();
 
   werase (exec_info->handle);
-  for (int cur_line = 1; cur_line <= win_info->content.size (); cur_line++)
+  for (int cur_line = 1; cur_line <= content.size (); cur_line++)
     mvwaddstr (exec_info->handle,
 	       cur_line,
 	       0,
-	       content[cur_line - 1]);
+	       exec_content[cur_line - 1]);
   exec_info->refresh_window ();
 }
 
@@ -676,7 +676,7 @@  void
 tui_source_window_base::update_exec_info ()
 {
   set_exec_info_content ();
-  tui_show_exec_info_content (this);
+  show_exec_info_content ();
 }
 
 void
diff --git a/gdb/tui/tui-winsource.h b/gdb/tui/tui-winsource.h
index 71201e51d89..c902ee0f17e 100644
--- a/gdb/tui/tui-winsource.h
+++ b/gdb/tui/tui-winsource.h
@@ -150,6 +150,9 @@  public:
   struct gdbarch *gdbarch = nullptr;
 
   std::vector<tui_source_element> content;
+
+private:
+  void show_exec_info_content ();
 };
 
 /* Update the execution windows to show the active breakpoints.  This
@@ -185,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_show_exec_info_content (struct tui_source_window_base *);
 extern void tui_erase_exec_info_content (struct tui_source_window_base *);
 extern void tui_clear_exec_info_content (struct tui_source_window_base *);