Call forget_cached_source_info to clear the stale source cache
authorH.J. Lu <hjl.tools@gmail.com>
Thu, 24 Oct 2019 22:43:21 +0000 (15:43 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Thu, 24 Oct 2019 22:43:21 +0000 (15:43 -0700)
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.

gdb/ChangeLog
gdb/symfile.c

index 664000add4d0396153980ed82d6f2bbbe8f35130..8447542d8ed57d7632c060be2e1b2ea6f25629e8 100644 (file)
@@ -1,3 +1,9 @@
+2019-10-24  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR gdb/25126
+       * symfile.c (reread_symbols): Call forget_cached_source_info to
+       clear the stale source cache.
+
 2019-10-24  Christian Biesinger  <cbiesinger@google.com>
 
        * configure: Regenerate.
index f74c6de5962536c41d90bd5a5adc8223e31e9702..d2ed1ccacdfa5a2a59ffeb5a3353dd6052ee1698 100644 (file)
@@ -2518,6 +2518,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);
This page took 0.037005 seconds and 4 git commands to generate.