[PATCH] D42765: [DebugInfo] Support DWARFv5 source code embedding extension

Scott Linder via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 31 13:55:51 PST 2018


scott.linder created this revision.
scott.linder added reviewers: echristo, arsenm, aprantl.
Herald added subscribers: llvm-commits, JDevlieghere, nhaehnle, wdng, emaste.
Herald added a reviewer: deadalnix.

In DWARFv5 the Line Number Program Header is extensible, allowing values
with new content types. In this extension two new content types are
added: DW_LNCT_has_source indicates whether embedded source is available
for the file, and DW_LNCT_source contains the embedded source itself.

Add new optional attribute for !DIFile IR metadata called source which
contains source text. Use this to output the source to the DWARF line
table of code objects. Analogously extend METADATA_FILE in Bitcode and
.file directive in ASM to support optional source.

Teach llvm-dwarfdump and llvm-objdump about the new values. Output
the source below file_names entries in llvm-dwarfdump, and support
embedded sources for the -source option in llvm-objdump.


Repository:
  rL LLVM

https://reviews.llvm.org/D42765

Files:
  docs/AMDGPUUsage.rst
  include/llvm-c/DebugInfo.h
  include/llvm/BinaryFormat/Dwarf.def
  include/llvm/DebugInfo/DIContext.h
  include/llvm/DebugInfo/DWARF/DWARFDebugLine.h
  include/llvm/IR/DIBuilder.h
  include/llvm/IR/DebugInfoMetadata.h
  include/llvm/MC/MCContext.h
  include/llvm/MC/MCDwarf.h
  include/llvm/MC/MCStreamer.h
  lib/AsmParser/LLParser.cpp
  lib/Bitcode/Reader/MetadataLoader.cpp
  lib/Bitcode/Writer/BitcodeWriter.cpp
  lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
  lib/CodeGen/AsmPrinter/DwarfDebug.cpp
  lib/CodeGen/AsmPrinter/DwarfUnit.cpp
  lib/DebugInfo/DWARF/DWARFDebugLine.cpp
  lib/IR/AsmWriter.cpp
  lib/IR/DIBuilder.cpp
  lib/IR/DebugInfo.cpp
  lib/IR/DebugInfoMetadata.cpp
  lib/IR/LLVMContextImpl.h
  lib/MC/MCAsmStreamer.cpp
  lib/MC/MCContext.cpp
  lib/MC/MCDwarf.cpp
  lib/MC/MCParser/AsmParser.cpp
  lib/MC/MCStreamer.cpp
  test/Assembler/debug-info.ll
  test/Bindings/llvm-c/debug_info.ll
  test/Bitcode/metadata-source.ll
  test/Bitcode/metadata-source.ll.bc
  test/CodeGen/Generic/dwarf-source.ll
  test/Linker/Inputs/metadata-source-a.ll
  test/Linker/Inputs/metadata-source-b.ll
  test/Linker/metadata-source.ll
  test/MC/AsmParser/debug-empty-source.s
  test/MC/AsmParser/debug-no-source.s
  test/MC/ELF/debug-md5-and-source.s
  test/MC/ELF/debug-source.s
  test/tools/llvm-objdump/Inputs/embedded-source
  test/tools/llvm-objdump/embedded-source.test
  tools/llvm-c-test/debuginfo.c
  tools/llvm-objdump/llvm-objdump.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42765.132268.patch
Type: text/x-patch
Size: 62352 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180131/2057dae6/attachment.bin>


More information about the llvm-commits mailing list