[PATCH] D45556: [DebugInfo] Generate DWARF debug information for labels.
Hsiangkai Wang via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 12 01:15:06 PDT 2018
HsiangKai created this revision.
HsiangKai added reviewers: rnk, chenwj, aprantl, probinson.
Herald added subscribers: JDevlieghere, eraman.
There are two forms for label debug information in DWARF format.
1. Labels in a non-inlined function:
DW_TAG_label
DW_AT_name
DW_AT_decl_file
DW_AT_decl_line
DW_AT_low_pc
2. Labels in an inlined function:
DW_TAG_label
DW_AT_abstract_origin
DW_AT_low_pc
We will collect label information from DBG_LABEL. Before every DBG_LABEL,
we will generate a temporary symbol to denote the location of the label.
The symbol could be used to get DW_AT_low_pc afterwards. So, we create a
mapping between 'inlined label' and DBG_LABEL MachineInstr in DebugHandlerBase.
The DBG_LABEL in the mapping is used to query the symbol before it.
The AbstractLabels in DwarfCompileUnit is used to process labels in inlined
functions.
We also keep a mapping between scope and labels in DwarfFile to help to
generate correct tree structure of DIEs.
Repository:
rL LLVM
https://reviews.llvm.org/D45556
Files:
lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp
lib/CodeGen/AsmPrinter/DebugHandlerBase.h
lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
lib/CodeGen/AsmPrinter/DwarfDebug.cpp
lib/CodeGen/AsmPrinter/DwarfDebug.h
lib/CodeGen/AsmPrinter/DwarfFile.cpp
lib/CodeGen/AsmPrinter/DwarfFile.h
lib/CodeGen/AsmPrinter/DwarfUnit.cpp
lib/CodeGen/AsmPrinter/DwarfUnit.h
test/DebugInfo/Generic/debug-label-inline.ll
test/DebugInfo/Generic/debug-label.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D45556.142125.patch
Type: text/x-patch
Size: 27842 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180412/15ae6def/attachment.bin>
More information about the llvm-commits
mailing list