[review] Don't call set_current_source_symtab_and_line from TUI

Tom Tromey (Code Review) gerrit@gnutoolchain-gerrit.osci.io
Thu Nov 14 23:36:00 GMT 2019


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(-)



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);
-	}
     }
 }
 

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



More information about the Gdb-patches mailing list