This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug symtab/17855] New: clear_symtab_users doesn't call observer_notify_new_objfile (NULL) early enough
- From: "xdje42 at gmail dot com" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: Sun, 18 Jan 2015 04:52:44 +0000
- Subject: [Bug symtab/17855] New: clear_symtab_users doesn't call observer_notify_new_objfile (NULL) early enough
- Auto-submitted: auto-generated
https://sourceware.org/bugzilla/show_bug.cgi?id=17855
Bug ID: 17855
Summary: clear_symtab_users doesn't call
observer_notify_new_objfile (NULL) early enough
Product: gdb
Version: HEAD
Status: NEW
Severity: normal
Priority: P2
Component: symtab
Assignee: unassigned at sourceware dot org
Reporter: xdje42 at gmail dot com
I ran into this with my symtab lookup cache patch, PR 17799.
I think the problem can also be seen from ada, which has its own symbol lookup
cache, except one will need to fix PR 17854 first (assuming I'm not missing
something).
diff --git a/gdb/symfile.c b/gdb/symfile.c
index d55e361..ad481de 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -3023,6 +3023,12 @@ clear_symtab_users (int add_flags)
/* Someday, we should do better than this, by only blowing away
the things that really need to be blown. */
+ /* Notify anyone listening that the previous loaded symtab(s) are invalid.
+ It is important to do this before calling breakpoint_re_set as the latter
+ will try to look up symbols, and for example the symbol cache needs to
+ be flushed first. */
+ observer_notify_new_objfile (NULL);
+
/* Clear the "current" symtab first, because it is no longer valid.
breakpoint_re_set may try to access the current symtab. */
clear_current_source_symtab_and_line ();
@@ -3032,7 +3038,6 @@ clear_symtab_users (int add_flags)
breakpoint_re_set ();
clear_last_displayed_sal ();
clear_pc_function_cache ();
- observer_notify_new_objfile (NULL);
/* Clear globals which might have pointed into a removed objfile.
FIXME: It's not clear which of these are supposed to persist
--
You are receiving this mail because:
You are on the CC list for the bug.