This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] [mips] Fix PR 21337 v1: segfault when re-reading symbols with remote debugging.


On 03/31/2017 06:04 PM, Doug Gilmore wrote:
This is a fix to a problem that was introduced with commit g3e29f34.


Which commit is that? I couldn't find it in the git tree.

Incidentally, i have a local patch that does pretty much the same thing, but a little further down compared to yours. It notifies gdb of objfile changes right before the call to read_symbols (...).

But my patch doesn't remove the original call to objfiles_changed (...). What is the rationale behind that change?

diff --git a/gdb/symfile.c b/gdb/symfile.c
index 8b79508..290b18b 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -2592,6 +2592,12 @@ reread_symbols (void)
 	  /* Free the obstacks for non-reusable objfiles.  */
 	  psymbol_bcache_free (objfile->psymbol_cache);
 	  objfile->psymbol_cache = psymbol_bcache_init ();
+
+	  /* Notify objfiles that we've modified objfile sections, which now
+	     needs to be done early to ensure that, for the MIPS target,
+	     find_pc_section won't access stale data.  PR 21337.  */

I think the PR number is not needed. After all the bug will be gone with this fix.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]