Patchwork [12/19] Change tui_set_exec_info_content to be a method

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

Comments

Tom Tromey - Aug. 3, 2019, 1:29 p.m.
This changes tui_set_exec_info_content to bea method on
tui_source_window_base.

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

	* tui/tui-winsource.h (struct tui_source_window_base)
	<set_exec_info_content>: Declare.
	(tui_set_exec_info_content): Don't declare.
	* tui/tui-winsource.c
	(tui_source_window_base::set_exec_info_content): Rename from
	tui_set_exec_info_content.
	(tui_update_exec_info): Update.
---
 gdb/ChangeLog           | 10 ++++++++++
 gdb/tui/tui-winsource.c | 16 ++++++++--------
 gdb/tui/tui-winsource.h |  3 ++-
 3 files changed, 20 insertions(+), 9 deletions(-)

Patch

diff --git a/gdb/tui/tui-winsource.c b/gdb/tui/tui-winsource.c
index bccc345fed9..c47da04e2a3 100644
--- a/gdb/tui/tui-winsource.c
+++ b/gdb/tui/tui-winsource.c
@@ -604,19 +604,19 @@  tui_exec_info_window::maybe_allocate_content (int n_elements)
    based upon the input window which is either the source or
    disassembly window.  */
 void
-tui_set_exec_info_content (struct tui_source_window_base *win_info)
+tui_source_window_base::set_exec_info_content ()
 {
-  tui_exec_info_content *content
-    = win_info->execution_info->maybe_allocate_content (win_info->height);
+  tui_exec_info_content *exec_content
+    = execution_info->maybe_allocate_content (height);
 
-  tui_update_breakpoint_info (win_info, nullptr, true);
-  for (int i = 0; i < win_info->content.size (); i++)
+  tui_update_breakpoint_info (this, nullptr, true);
+  for (int i = 0; i < content.size (); i++)
     {
-      tui_exec_info_content &element = content[i];
+      tui_exec_info_content &element = exec_content[i];
       struct tui_source_element *src_element;
       tui_bp_flags mode;
 
-      src_element = &win_info->content[i];
+      src_element = &content[i];
 
       memset (element, ' ', sizeof (tui_exec_info_content));
       element[TUI_EXECINFO_SIZE - 1] = 0;
@@ -675,7 +675,7 @@  tui_clear_exec_info_content (struct tui_source_window_base *win_info)
 void
 tui_update_exec_info (struct tui_source_window_base *win_info)
 {
-  tui_set_exec_info_content (win_info);
+  win_info->set_exec_info_content ();
   tui_show_exec_info_content (win_info);
 }
 
diff --git a/gdb/tui/tui-winsource.h b/gdb/tui/tui-winsource.h
index 8c76322d069..645cd6717d6 100644
--- a/gdb/tui/tui-winsource.h
+++ b/gdb/tui/tui-winsource.h
@@ -91,6 +91,8 @@  public:
 
   void show_source_content ();
 
+  void set_exec_info_content ();
+
   /* Does the locator belong to this window?  */
   bool m_has_locator = false;
   /* Execution information window.  */
@@ -141,7 +143,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_set_exec_info_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 *);