Patchwork [review] Don't call set_current_source_symtab_and_line from TUI

login
register
mail settings
Submitter Simon Marchi (Code Review)
Date Nov. 14, 2019, 11:35 p.m.
Message ID <gerrit.1573774548000.I1152fc7c78150974bd3d555b8568a6f88b65dbe6@gnutoolchain-gerrit.osci.io>
Download mbox | patch
Permalink /patch/35917/
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/+/647
......................................................................

Don't call set_current_source_symtab_and_line from TUI

update_source_window_as_is calls set_current_source_symtab_and_line,
but I don't think there is any reason it should be doing this.  This
patch removes the call.

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

	* tui/tui-winsource.c
	(tui_source_window_base::update_source_window_as_is): Don't call
	set_current_source_symtab_and_line.

Change-Id: I1152fc7c78150974bd3d555b8568a6f88b65dbe6
---
M gdb/ChangeLog
M gdb/tui/tui-winsource.c
2 files changed, 6 insertions(+), 7 deletions(-)

Patch

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index a7eaf18..dbe3a93 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@ 
 2019-11-14  Tom Tromey  <tom@tromey.com>
 
+	* tui/tui-winsource.c
+	(tui_source_window_base::update_source_window_as_is): Don't call
+	set_current_source_symtab_and_line.
+
+2019-11-14  Tom Tromey  <tom@tromey.com>
+
 	* tui/tui-stack.h (struct tui_locator_window) <set_locator_info>:
 	Take a symtab_and_line.
 	* tui/tui-stack.c (tui_locator_window::set_locator_info): Take a
diff --git a/gdb/tui/tui-winsource.c b/gdb/tui/tui-winsource.c
index 4b58311..4a4087d 100644
--- a/gdb/tui/tui-winsource.c
+++ b/gdb/tui/tui-winsource.c
@@ -183,13 +183,6 @@ 
       update_breakpoint_info (nullptr, false);
       show_source_content ();
       update_exec_info ();
-      if (type == SRC_WIN)
-	{
-	  symtab_and_line new_sal = sal;
-
-	  new_sal.line = sal.line + (content.size () - 2);
-	  set_current_source_symtab_and_line (new_sal);
-	}
     }
 }