[Bug gdb/21337] [mips] segfault when re-reading symbols with remote debugging.

cvs-commit at gcc dot gnu.org sourceware-bugzilla@sourceware.org
Wed Jun 28 02:01:00 GMT 2017


--- Comment #2 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Maciej W. Rozycki <macro@sourceware.org>:


commit 41664b45ab6387184bd0e7512fcf7a72c58744e7
Author: Doug Gilmore <Doug.Gilmore@imgtec.com>
Date:   Wed Jun 28 02:54:22 2017 +0100

    Fix PR 21337: segfault when re-reading symbols.

    Fix issue exposed by commit 3e29f34.

    The basic issue is that section data referenced through an objfile
    pointer can also be referenced via the program-space data pointer,
    although via a separate mapping mechanism, which is set up by
    update_section_map.  Thus once section data attached to an objfile
    pointer is released, the section map associated with the program-space
    data pointer must be marked dirty to ensure that update_section_map is
    called to prevent stale data being referenced.  For the matter at hand
    this marking is being done via a call to objfiles_changed.

    Before commit 3e29f34 objfiles_changed could be called after all of
    the objfile pointers were processed in reread_symbols since section
    data references via the program-space data pointer would not occur in
    the calls of read_symbols performed by reread_symbols.

    With commit 3e29f34 MIPS target specific calls to find_pc_section were
    added to the code for DWARF information processing, which is called
    via read_symbols.  Thus in reread_symbols the call to objfiles_changed
    needs to be called before calling read_symbols, otherwise stale
    section data can be referenced.

    Thanks to Luis Machado for providing text for the main comment
    associated with the change.

    2017-06-28  Doug Gilmore  <Doug.Gilmore@imgtec.com>
        PR gdb/21337
        * symfile.c (reread_symbols): Call objfiles_changed just before

    2017-06-28  Doug Gilmore  <Doug.Gilmore@imgtec.com>
        PR gdb/21337
        * gdb.base/reread-readsym.exp: New file.
        * gdb.base/reread-readsym.c: New file.

You are receiving this mail because:
You are on the CC list for the bug.

More information about the Gdb-prs mailing list