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

Alexey Lapshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 1 11:46:15 PST 2019


avl created this revision.
avl added reviewers: probinson, dblaikie, aprantl.
avl added projects: LLVM, debug-info.
Herald added a subscriber: hiraditya.
Herald added a reviewer: JDevlieghere.

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.


https://reviews.llvm.org/D70879

Files:
  llvm/include/llvm/CodeGen/AsmPrinter.h
  llvm/include/llvm/CodeGen/DIE.h
  llvm/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp
  llvm/lib/CodeGen/AsmPrinter/DIE.cpp
  llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
  llvm/lib/CodeGen/AsmPrinter/DwarfFile.cpp
  llvm/lib/CodeGen/AsmPrinter/DwarfFile.h
  llvm/test/CodeGen/X86/dwarf-headers.ll
  llvm/test/DebugInfo/X86/debug_addr.ll
  llvm/test/DebugInfo/X86/string-offsets-table-order.ll
  llvm/test/DebugInfo/X86/string-offsets-table.ll
  llvm/tools/dsymutil/DwarfStreamer.cpp
  llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D70879.231622.patch
Type: text/x-patch
Size: 10372 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191201/45a32fb9/attachment-0001.bin>


More information about the llvm-commits mailing list