Blob Blame History Raw
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
From: Sergio Durigan Junior <sergiodj@redhat.com>
Date: Tue, 11 Feb 2020 15:15:44 -0500
Subject: gdb-rhbz1784210-clear-source-cache-reload-binary-1of2.patch

;; Fix "Incorrect printing of source lines (colorized source lines not
;; updated when source reloaded?)" (H.J. Lu, RHBZ 1784210).

Call forget_cached_source_info to clear the stale source cache

Clear the stale source cache when re-reading symbols.

	PR gdb/25126
	* symfile.c (reread_symbols): Call forget_cached_source_info to
	clear the stale source cache.

diff --git a/gdb/symfile.c b/gdb/symfile.c
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -2528,6 +2528,9 @@ reread_symbols (void)
 	     automatically recreated by sym_read.  */
 	  free_objfile_separate_debug (objfile);
 
+	  /* Clear the stale source cache.  */
+	  forget_cached_source_info ();
+
 	  /* Remove any references to this objfile in the global
 	     value lists.  */
 	  preserve_values (objfile);