From 7b71fc971bd31b27cce8b883007ad467a7567499 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Thu, 24 Oct 2019 15:43:21 -0700 Subject: [PATCH] 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. --- gdb/ChangeLog | 6 ++++++ gdb/symfile.c | 3 +++ 2 files changed, 9 insertions(+) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 664000add4d..8447542d8ed 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2019-10-24 H.J. Lu + + PR gdb/25126 + * symfile.c (reread_symbols): Call forget_cached_source_info to + clear the stale source cache. + 2019-10-24 Christian Biesinger * configure: Regenerate. diff --git a/gdb/symfile.c b/gdb/symfile.c index f74c6de5962..d2ed1ccacdf 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -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); -- 2.30.2