This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] [mips] Fix PR 21337 v1: segfault when re-reading symbols with remote debugging.
- From: Luis Machado <lgustavo at codesourcery dot com>
- To: Doug Gilmore <Doug dot Gilmore at imgtec dot com>, <gdb-patches at sourceware dot org>
- Date: Wed, 12 Apr 2017 13:52:43 -0500
- Subject: Re: [PATCH] [mips] Fix PR 21337 v1: segfault when re-reading symbols with remote debugging.
- Authentication-results: sourceware.org; auth=none
- References: <d7619e0c-38f4-b547-8117-8e5315313b71@imgtec.com>
- Reply-to: Luis Machado <lgustavo at codesourcery dot com>
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.