public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] Change tui_show_source_content to be a method
@ 2019-08-13 20:54 Tom Tromey
  0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2019-08-13 20:54 UTC (permalink / raw)
  To: gdb-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=0bd27e079a99d93590fd078c86c0afe51f6d29b8

commit 0bd27e079a99d93590fd078c86c0afe51f6d29b8
Author: Tom Tromey <tom@tromey.com>
Date:   Fri Jul 5 17:18:18 2019 -0600

    Change tui_show_source_content to be a method
    
    This changes tui_show_source_content to be a method on
    tui_source_window_base.
    
    gdb/ChangeLog
    2019-08-13  Tom Tromey  <tom@tromey.com>
    
    	* tui/tui-winsource.h (struct tui_source_window_base)
    	<show_source_content>: Declare.
    	(tui_show_source_content): Don't declare.
    	* tui/tui-winsource.c (tui_update_source_window_as_is): Update.
    	(tui_source_window_base::show_source_content): Rename from
    	tui_show_source_content.
    	(tui_source_window_base::refresh_all): Update.
    	* tui/tui-layout.c (show_source_disasm_command)
    	(show_source_or_disasm_and_command): Update.

Diff:
---
 gdb/ChangeLog           | 12 ++++++++++++
 gdb/tui/tui-layout.c    |  6 +++---
 gdb/tui/tui-winsource.c | 18 +++++++++---------
 gdb/tui/tui-winsource.h |  3 ++-
 4 files changed, 26 insertions(+), 13 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 1c2b0d8..a43a8f3 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,17 @@
 2019-08-13  Tom Tromey  <tom@tromey.com>
 
+	* tui/tui-winsource.h (struct tui_source_window_base)
+	<show_source_content>: Declare.
+	(tui_show_source_content): Don't declare.
+	* tui/tui-winsource.c (tui_update_source_window_as_is): Update.
+	(tui_source_window_base::show_source_content): Rename from
+	tui_show_source_content.
+	(tui_source_window_base::refresh_all): Update.
+	* tui/tui-layout.c (show_source_disasm_command)
+	(show_source_or_disasm_and_command): Update.
+
+2019-08-13  Tom Tromey  <tom@tromey.com>
+
 	* tui/tui-winsource.c (tui_erase_source_content)
 	(tui_show_source_content, tui_source_window_base::refresh_all):
 	Update.
diff --git a/gdb/tui/tui-layout.c b/gdb/tui/tui-layout.c
index 2715d32..3683835 100644
--- a/gdb/tui/tui-layout.c
+++ b/gdb/tui/tui-layout.c
@@ -520,7 +520,7 @@ show_source_disasm_command (void)
   struct tui_locator_window *locator = tui_locator_win_info_ptr ();
   gdb_assert (locator != nullptr);
 
-  tui_show_source_content (TUI_SRC_WIN);
+  TUI_SRC_WIN->show_source_content ();
   if (TUI_DISASM_WIN == NULL)
     tui_win_list[DISASSEM_WIN] = new tui_disasm_window ();
   TUI_DISASM_WIN->reset (asm_height,
@@ -536,7 +536,7 @@ show_source_disasm_command (void)
   TUI_DISASM_WIN->m_has_locator = true;
   locator->make_visible (true);
   tui_show_locator_content ();
-  tui_show_source_content (TUI_DISASM_WIN);
+  TUI_DISASM_WIN->show_source_content ();
 
   if (TUI_CMD_WIN == NULL)
     tui_win_list[CMD_WIN] = new tui_cmd_window ();
@@ -664,7 +664,7 @@ show_source_or_disasm_and_command (enum tui_layout_type layout_type)
   win_info->m_has_locator = true;
   locator->make_visible (true);
   tui_show_locator_content ();
-  tui_show_source_content (win_info);
+  win_info->show_source_content ();
 
   if (TUI_CMD_WIN == NULL)
     tui_win_list[CMD_WIN] = new tui_cmd_window ();
diff --git a/gdb/tui/tui-winsource.c b/gdb/tui/tui-winsource.c
index 6a72c6f..bccc345 100644
--- a/gdb/tui/tui-winsource.c
+++ b/gdb/tui/tui-winsource.c
@@ -105,7 +105,7 @@ tui_update_source_window_as_is (struct tui_source_window_base *win_info,
   else
     {
       tui_update_breakpoint_info (win_info, nullptr, false);
-      tui_show_source_content (win_info);
+      win_info->show_source_content ();
       tui_update_exec_info (win_info);
       if (win_info->type == SRC_WIN)
 	{
@@ -275,20 +275,20 @@ tui_show_source_line (struct tui_source_window_base *win_info, int lineno)
 }
 
 void
-tui_show_source_content (struct tui_source_window_base *win_info)
+tui_source_window_base::show_source_content ()
 {
-  if (!win_info->content.empty ())
+  if (!content.empty ())
     {
       int lineno;
 
-      for (lineno = 1; lineno <= win_info->content.size (); lineno++)
-        tui_show_source_line (win_info, lineno);
+      for (lineno = 1; lineno <= content.size (); lineno++)
+        tui_show_source_line (this, lineno);
     }
   else
-    tui_erase_source_content (win_info);
+    tui_erase_source_content (this);
 
-  win_info->check_and_display_highlight_if_needed ();
-  win_info->refresh_window ();
+  check_and_display_highlight_if_needed ();
+  refresh_window ();
 }
 
 /* See tui-data.h.  */
@@ -332,7 +332,7 @@ tui_source_window_base::reset (int height, int width,
 void
 tui_source_window_base::refresh_all ()
 {
-  tui_show_source_content (this);
+  show_source_content ();
   check_and_display_highlight_if_needed ();
   tui_erase_exec_info_content (this);
   tui_update_exec_info (this);
diff --git a/gdb/tui/tui-winsource.h b/gdb/tui/tui-winsource.h
index 9d7f0a7..8c76322 100644
--- a/gdb/tui/tui-winsource.h
+++ b/gdb/tui/tui-winsource.h
@@ -89,6 +89,8 @@ public:
   void reset (int height, int width,
 	      int origin_x, int origin_y) override;
 
+  void show_source_content ();
+
   /* Does the locator belong to this window?  */
   bool m_has_locator = false;
   /* Execution information window.  */
@@ -139,7 +141,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_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 *);


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-08-13 20:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-13 20:54 [binutils-gdb] Change tui_show_source_content to be a method Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).