[review,v2] Don't call set_current_source_symtab_and_line from TUI

Message ID 20191212023506.11C3A25BB4@gnutoolchain-gerrit.osci.io
State Superseded
Headers show
Series
  • [review,v2] Don't call set_current_source_symtab_and_line from TUI
Related show

Commit Message

Christian Biesinger (Code Review) Dec. 12, 2019, 2:35 a.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.

2019-12-11  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(-)




-- 
Gerrit-Project: binutils-gdb
Gerrit-Branch: master
Gerrit-Change-Id: I1152fc7c78150974bd3d555b8568a6f88b65dbe6
Gerrit-Change-Number: 647
Gerrit-PatchSet: 2
Gerrit-Owner: Tom Tromey <tromey@sourceware.org>
Gerrit-MessageType: newpatchset

Patch

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 5559a94..da348cd 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@ 
 2019-12-11  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-12-11  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 3305c8c..1ac650b 100644
--- a/gdb/tui/tui-winsource.c
+++ b/gdb/tui/tui-winsource.c
@@ -190,13 +190,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);
-	}
     }
 }