Patchwork [review] Remove tui_source_window::show_symtab_source

login
register
mail settings
Submitter Simon Marchi (Code Review)
Date Nov. 14, 2019, 11:35 p.m.
Message ID <gerrit.1573774548000.I41781df2126e8bafad46d058532d52602a288e06@gnutoolchain-gerrit.osci.io>
Download mbox | patch
Permalink /patch/35909/
State New
Headers show

Comments

Simon Marchi (Code Review) - Nov. 14, 2019, 11:35 p.m.
Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/637
......................................................................

Remove tui_source_window::show_symtab_source

tui_source_window::show_symtab_source is identical to
update_source_window, so remove the former.

gdb/ChangeLog
2019-11-14  Tom Tromey  <tom@tromey.com>

	* tui/tui-winsource.c (tui_update_source_windows_with_addr)
	(tui_update_source_windows_with_line): Call update_source_window.
	* tui/tui-source.h (struct tui_source_window)
	<show_symtab_source>: Don't declare.
	* tui/tui-source.c (tui_source_window::show_symtab_source):
	Remove.

Change-Id: I41781df2126e8bafad46d058532d52602a288e06
---
M gdb/ChangeLog
M gdb/tui/tui-source.c
M gdb/tui/tui-source.h
M gdb/tui/tui-winsource.c
4 files changed, 11 insertions(+), 17 deletions(-)

Patch

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index db53067..619815b 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,14 @@ 
 2019-11-14  Tom Tromey  <tom@tromey.com>
 
+	* tui/tui-winsource.c (tui_update_source_windows_with_addr)
+	(tui_update_source_windows_with_line): Call update_source_window.
+	* tui/tui-source.h (struct tui_source_window)
+	<show_symtab_source>: Don't declare.
+	* tui/tui-source.c (tui_source_window::show_symtab_source):
+	Remove.
+
+2019-11-14  Tom Tromey  <tom@tromey.com>
+
 	* tui/tui-winsource.c (tui_update_source_windows_with_addr): Call
 	update_source_window directly.
 	* tui/tui-disasm.h (tui_show_disassem): Don't declare.
diff --git a/gdb/tui/tui-source.c b/gdb/tui/tui-source.c
index cf0b8ce..197a3bb 100644
--- a/gdb/tui/tui-source.c
+++ b/gdb/tui/tui-source.c
@@ -112,18 +112,6 @@ 
 }
 
 
-/* Function to display source in the source window.  This function
-   initializes the horizontal scroll to 0.  */
-void
-tui_source_window::show_symtab_source (struct gdbarch *gdbarch,
-				       struct symtab *s,
-				       struct tui_line_or_address line)
-{
-  horizontal_offset = 0;
-  update_source_window_as_is (gdbarch, s, line);
-}
-
-
 /* Answer whether the source is currently displayed in the source
    window.  */
 bool
diff --git a/gdb/tui/tui-source.h b/gdb/tui/tui-source.h
index 15d1429..a573ce4 100644
--- a/gdb/tui/tui-source.h
+++ b/gdb/tui/tui-source.h
@@ -56,9 +56,6 @@ 
     do_erase_source_content (_("[ No Source Available ]"));
   }
 
-  void show_symtab_source (struct gdbarch *, struct symtab *,
-			   struct tui_line_or_address);
-
 protected:
 
   void do_scroll_vertical (int num_to_scroll) override;
diff --git a/gdb/tui/tui-winsource.c b/gdb/tui/tui-winsource.c
index 8b96fdf..ce4e655 100644
--- a/gdb/tui/tui-winsource.c
+++ b/gdb/tui/tui-winsource.c
@@ -220,7 +220,7 @@ 
 	{
 	  l.loa = LOA_LINE;
 	  l.u.line_no = sal.line;
-	  TUI_SRC_WIN->show_symtab_source (gdbarch, sal.symtab, l);
+	  TUI_SRC_WIN->update_source_window (gdbarch, sal.symtab, l);
 	}
     }
   else
@@ -254,7 +254,7 @@ 
     default:
       l.loa = LOA_LINE;
       l.u.line_no = line;
-      TUI_SRC_WIN->show_symtab_source (gdbarch, s, l);
+      TUI_SRC_WIN->update_source_window (gdbarch, s, l);
       if (tui_current_layout () == SRC_DISASSEM_COMMAND)
 	{
 	  find_line_pc (s, line, &pc);