[11/61] Introduce tui_data_window::display_all_data method

Message ID 20190704170311.15982-12-tom@tromey.com
State New
Headers show
Series
  • More TUI refactorings
Related show

Commit Message

Tom Tromey July 4, 2019, 5:02 p.m.
This changes tui_display_all_data to be a method on tui_data_window.
This helps cluster uses of the TUI_DATA_WIN global.

2019-07-04  Tom Tromey  <tom@tromey.com>

	* tui/tui-windata.h (tui_display_all_data): Don't declare.
	* tui/tui-windata.c (tui_data_window::display_all_data): Rename
	from tui_display_all_data.
	* tui/tui-win.c
	(tui_data_window::do_make_visible_with_new_height): Update.
	* tui/tui-regs.c (tui_show_registers): Update.
	* tui/tui-layout.c (tui_set_layout): Update.
	* tui/tui-data.h (struct tui_data_window) <display_all_data>: New
	method.
---
 gdb/ChangeLog         | 12 ++++++++++++
 gdb/tui/tui-data.h    |  4 ++++
 gdb/tui/tui-layout.c  |  2 +-
 gdb/tui/tui-regs.c    |  2 +-
 gdb/tui/tui-win.c     |  2 +-
 gdb/tui/tui-windata.c |  6 +++---
 gdb/tui/tui-windata.h |  1 -
 7 files changed, 22 insertions(+), 7 deletions(-)

-- 
2.17.2

Patch

diff --git a/gdb/tui/tui-data.h b/gdb/tui/tui-data.h
index 676345c528a..5cdd7561e62 100644
--- a/gdb/tui/tui-data.h
+++ b/gdb/tui/tui-data.h
@@ -503,6 +503,10 @@  struct tui_data_window : public tui_win_info
      past the register area (-1) is returned.  */
   int first_reg_element_no_inline (int line_no) const;
 
+  /* This function displays the data that is in the data window's
+     content.  It does not set the content.  */
+  void display_all_data ();
+
 protected:
 
   void do_scroll_vertical (int num_to_scroll) override;
diff --git a/gdb/tui/tui-layout.c b/gdb/tui/tui-layout.c
index d9a1f08ac1f..9e683cfa919 100644
--- a/gdb/tui/tui-layout.c
+++ b/gdb/tui/tui-layout.c
@@ -215,7 +215,7 @@  tui_set_layout (enum tui_layout_type layout_type)
 	  if (!regs_populate
 	      && (new_layout == SRC_DATA_COMMAND
 		  || new_layout == DISASSEM_DATA_COMMAND))
-	    tui_display_all_data ();
+	    TUI_DATA_WIN->display_all_data ();
 
 	  tui_update_source_windows_with_addr (gdbarch, addr);
 
diff --git a/gdb/tui/tui-regs.c b/gdb/tui/tui-regs.c
index ae38d343822..59933639f6f 100644
--- a/gdb/tui/tui-regs.c
+++ b/gdb/tui/tui-regs.c
@@ -157,7 +157,7 @@  tui_show_registers (struct reggroup *group)
 	    data_item_win->highlight = false;
 	}
       TUI_DATA_WIN->current_group = group;
-      tui_display_all_data ();
+      TUI_DATA_WIN->display_all_data ();
     }
 }
 
diff --git a/gdb/tui/tui-win.c b/gdb/tui/tui-win.c
index 557f8b5d2d6..ee03cf38e14 100644
--- a/gdb/tui/tui-win.c
+++ b/gdb/tui/tui-win.c
@@ -1366,7 +1366,7 @@  tui_source_window_base::do_make_visible_with_new_height ()
 void
 tui_data_window::do_make_visible_with_new_height ()
 {
-  tui_display_all_data ();
+  display_all_data ();
 }
 
 /* See tui-data.h.  */
diff --git a/gdb/tui/tui-windata.c b/gdb/tui/tui-windata.c
index 722d0a5e26e..dd2daf19332 100644
--- a/gdb/tui/tui-windata.c
+++ b/gdb/tui/tui-windata.c
@@ -97,15 +97,15 @@  tui_erase_data_content (const char *prompt)
 /* This function displays the data that is in the data window's
    content.  It does not set the content.  */
 void
-tui_display_all_data (void)
+tui_data_window::display_all_data ()
 {
-  if (TUI_DATA_WIN->regs_content.empty ())
+  if (regs_content.empty ())
     tui_erase_data_content (NO_DATA_STRING);
   else
     {
       tui_erase_data_content (NULL);
       tui_delete_data_content_windows ();
-      tui_check_and_display_highlight_if_needed (TUI_DATA_WIN);
+      tui_check_and_display_highlight_if_needed (this);
       tui_display_registers_from (0);
     }
 }
diff --git a/gdb/tui/tui-windata.h b/gdb/tui/tui-windata.h
index 9970cfae547..adffcafacb4 100644
--- a/gdb/tui/tui-windata.h
+++ b/gdb/tui/tui-windata.h
@@ -25,7 +25,6 @@ 
 #include "tui/tui-data.h"
 
 extern void tui_erase_data_content (const char *);
-extern void tui_display_all_data (void);
 extern void tui_delete_data_content_windows (void);
 extern void tui_refresh_data_win (void);