This is an archive of the discontinued LLVM Phabricator instance.

[DWARF5][Debuginfo] Compilation unit type (DW_UT_skeleton) and root DIE (DW_TAG_compile_unit) do not match.
AbandonedPublic

Authored by avl on Dec 1 2019, 11:45 AM.

Details

Summary

That patch fixes "incompatible compilation unit type (DW_UT_skeleton) and root DIE (DW_TAG_compile_unit)" error.

cat split-dwarf.cpp
#include <iostream>

int main()
{

int a = 1;
std::cout << "Split DWARF test" << std::endl;
 
return 0;

}

clang++ -O -g -gsplit-dwarf -gdwarf-5 split-dwarf.cpp; llvm-dwarfdump --verify ./a.out | grep skeleton

error: Compilation unit type (DW_UT_skeleton) and root DIE (DW_TAG_compile_unit) do not match.

According to "3.1.2 Skeleton Compilation Unit Entries" part of "DWARF Debugging Information Format Version 5"
: "When generating a split DWARF object file (see Section 7.3.2 on page 187), the
compilation unit in the .debug_info section is a "skeleton" compilation unit with
the tag DW_TAG_skeleton_unit".

The fix is to change DW_TAG_compile_unit into DW_TAG_skeleton_unit tag when skeleton file is generated.

Diff Detail

Event Timeline

avl created this revision.Dec 1 2019, 11:45 AM
avl abandoned this revision.Dec 1 2019, 1:19 PM
avl added a comment.Dec 2 2019, 1:27 AM

resubmitted this review - D70880