[Bug c++/24470] Segmentation fault in gdb/symtab.c

cvs-commit at gcc dot gnu.org sourceware-bugzilla@sourceware.org
Tue Apr 30 13:28:00 GMT 2019


https://sourceware.org/bugzilla/show_bug.cgi?id=24470

--- Comment #8 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tom Tromey <tromey@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=a776957c8c3a9177345ee7ca91077234ed7f508e

commit a776957c8c3a9177345ee7ca91077234ed7f508e
Author: Tom Tromey <tromey@adacore.com>
Date:   Mon Apr 22 11:46:47 2019 -0600

    Fix crash in dwarf2read.c with template parameters

    PR c++/24470 concerns a crash in dwarf2read.c that occurs with a
    particular test case.

    The issue turns out to be that process_structure_scope will pass NULL
    to symbol_symtab.  This happens because new_symbol decided not to
    create a symbol for the particular DIE.

    This patch fixes the problem by finding another reasonably-appropriate
    symtab to use instead; issuing a complaint if one cannot be found for
    some reason.

    As mentioned in the bug, I think there are other bugs here.  For
    example, when using "ptype" on the "l" object in the test case, I
    think I would expect to see the template parameter.  I didn't research
    this too closely, since it seemed more important to fix the crash.

    Tested on x86-64 Fedora 29.

    I'd like to check this in to the 8.3 branch as well.

    2019-04-30  Tom Tromey  <tromey@adacore.com>

        PR c++/24470:
        * dwarf2read.c (process_structure_scope): Handle case where type
        has template parameters but no symbol was created.

    gdb/testsuite/ChangeLog
    2019-04-30  Tom Tromey  <tromey@adacore.com>

        PR c++/24470:
        * gdb.cp/temargs.cc: Add test code from PR.

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


More information about the Gdb-prs mailing list