[PATCH] [mips] Fix PR 21337 v1: segfault when re-reading symbols with remote debugging.
Doug Gilmore
Doug.Gilmore@imgtec.com
Wed Apr 12 21:42:00 GMT 2017
On 04/12/2017 11:52 AM, Luis Machado wrote:
> 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.
$ git log -n 1 3e29f34 | head
commit 3e29f34a4eef29f5b159749ccb1efb8867b2e651
Author: Maciej W. Rozycki <macro@codesourcery.com>
Date: Fri Dec 12 13:31:53 2014 +0000
MIPS: Keep the ISA bit in compressed code addresses
1. Background information
The MIPS architecture, as originally designed and implemented in
mid-1980s has a uniform instruction word size that is 4 bytes, naturally
$
>
> 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 (...).
That location is fine too, I just put the call at the point that
the data actually becomes stale.
>
> But my patch doesn't remove the original call to objfiles_changed
> (...). What is the rationale behind that change?
I removed it just because would always be an duplicate call.
>
>> 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.
Your right, people can just run "git log -p" to recover that information.
I'll update the patch accordingly.
Thanks,
Doug
More information about the Gdb-patches
mailing list