DWARF 5 support: Handle dwo_id
authorAli Tamur <tamur@google.com>
Tue, 27 Aug 2019 00:53:24 +0000 (17:53 -0700)
committerAli Tamur <tamur@google.com>
Tue, 10 Sep 2019 01:35:43 +0000 (18:35 -0700)
commita084a2a6a181c2206be4ba29b21dc0ae441ab4e9
tree26c98104519f4566444b83757fecb2aae3431ac4
parentb76c1a8361f78302d760b0f79f780193c801a724
DWARF 5 support: Handle dwo_id

* DW_UT_skeleton and DW_UT_split_compile compilation units have dwo ids
to match the compilation unit in the skeleton and .dwo files. The dwo_id is
in the header.

Tested with CC=/usr/bin/gcc (version 8.3.0) against master branch (also with
-gsplit-dwarf and -gdwarf-4 flags) and there was no increase in the set of
tests that fails.

This is part of an effort to support DWARF 5 in gdb.

gdb/ChangeLog:

        * dwarf2read.c (comp_unit_head): Update comment.
        (dwarf2_dwo_name): New function declaration.
        (dwarf_unit_type_name): New function declaration.
        (read_comp_unit_head): Add support for new compilation units,
        DW_UT_partial, DW_UT_skeleton, DW_UT_split_compile, DW_UT_split_type.
        Particularly, DW_UT_skeleton and DW_UT_split_compile have dwo_id
        (currently named as "signature") in their header. Also clarify error
        messages.
        (lookup_dwo_id): New function. Returns the dwo id of the given
        compile unit.
        (lookup_dwo_unit): Use the new lookup_dwo_id function.
        (init_cutu_and_read_dies): Use the new dwarf2_dwo_name and lookup_dwo_id
        functions.
        (create_dwo_cu_reader): Use the added lookup_dwo_id function.
        (dwarf2_dwo_name): Get the dwo name if present.
        (dwarf_unit_type_name): Convert DW_UT_* types to string for diagnostic
        purposes.
gdb/ChangeLog
gdb/dwarf2read.c