llvm-project/llvm/lib/CodeGen/AsmPrinter
Vedant Kumar 5931b4e5b5 [DebugInfo] Add support for DWARF5 call site-related attributes
DWARF v5 introduces DW_AT_call_all_calls, a subprogram attribute which
indicates that all calls (both regular and tail) within the subprogram
have call site entries. The information within these call site entries
can be used by a debugger to populate backtraces with synthetic tail
call frames.

Tail calling frames go missing in backtraces because the frame of the
caller is reused by the callee. Call site entries allow a debugger to
reconstruct a sequence of (tail) calls which led from one function to
another. This improves backtrace quality. There are limitations: tail
recursion isn't handled, variables within synthetic frames may not
survive to be inspected, etc. This approach is not novel, see:

  https://gcc.gnu.org/wiki/summit2010?action=AttachFile&do=get&target=jelinek.pdf

This patch adds an IR-level flag (DIFlagAllCallsDescribed) which lowers
to DW_AT_call_all_calls. It adds the minimal amount of DWARF generation
support needed to emit standards-compliant call site entries. For easier
deployment, when the debugger tuning is LLDB, the DWARF requirement is
adjusted to v4.

Testing: Apart from check-{llvm, clang}, I built a stage2 RelWithDebInfo
clang binary. Its dSYM passed verification and grew by 1.4% compared to
the baseline. 151,879 call site entries were added.

rdar://42001377

Differential Revision: https://reviews.llvm.org/D49887

llvm-svn: 343883
2018-10-05 20:37:17 +00:00
..
ARMException.cpp Use assembler expressions to lay out the EH LSDA. 2018-02-09 17:00:25 +00:00
AccelTable.cpp DebugInfo: Fix skipping CUs in DWARFv5 debug_names table 2018-08-24 20:31:05 +00:00
AddressPool.cpp [DWARF] - Emit the correct value for DW_AT_addr_base. 2018-09-20 09:17:36 +00:00
AddressPool.h [DWARF] - Emit the correct value for DW_AT_addr_base. 2018-09-20 09:17:36 +00:00
AsmPrinter.cpp Remove FrameAccess struct from hasLoadFromStackSlot 2018-09-05 08:59:50 +00:00
AsmPrinterDwarf.cpp Revert r343317 2018-09-28 17:01:50 +00:00
AsmPrinterHandler.h Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00
AsmPrinterInlineAsm.cpp [CodeGen] emit inline asm clobber list warnings for reserved (cont) 2018-08-30 12:52:35 +00:00
ByteStreamer.h Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00
CMakeLists.txt [DebugInfo] Generate DWARF debug information for labels. (Fix leak problems) 2018-08-17 15:22:04 +00:00
CodeViewDebug.cpp [CodeView] Only add the Scoped flag for an enum type when it has an immediate function scope to match MSVC 2018-10-02 20:28:15 +00:00
CodeViewDebug.h [CodeView] Emit function options for subprogram and member functions 2018-10-02 20:21:05 +00:00
DIE.cpp Rename DEBUG macro to LLVM_DEBUG. 2018-05-14 12:53:11 +00:00
DIEHash.cpp Rename DEBUG macro to LLVM_DEBUG. 2018-05-14 12:53:11 +00:00
DIEHash.h Fix -Wdocumentation warning. NFCI. 2018-07-18 09:07:54 +00:00
DIEHashAttributes.def Fix DIEHash refactoring that dropped the DW_AT_name from the hash 2017-05-23 18:36:07 +00:00
DbgEntityHistoryCalculator.cpp [DebugInfo] Do not generate label debug info if it has been processed. 2018-09-06 02:22:06 +00:00
DbgEntityHistoryCalculator.h [DebugInfo] Do not generate label debug info if it has been processed. 2018-09-06 02:22:06 +00:00
DebugHandlerBase.cpp [DebugInfo] Generate DWARF debug information for labels. (Fix leak problems) 2018-08-17 15:22:04 +00:00
DebugHandlerBase.h [DebugInfo] Generate DWARF debug information for labels. (Fix leak problems) 2018-08-17 15:22:04 +00:00
DebugLocEntry.h llvm::sort(C.begin(), C.end(), ...) -> llvm::sort(C, ...) 2018-09-27 02:13:45 +00:00
DebugLocStream.cpp
DebugLocStream.h Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00
DwarfCFIException.cpp Move TargetLoweringObjectFile from CodeGen to Target to fix layering 2018-03-23 23:58:19 +00:00
DwarfCompileUnit.cpp [DebugInfo] Add support for DWARF5 call site-related attributes 2018-10-05 20:37:17 +00:00
DwarfCompileUnit.h [DebugInfo] Add support for DWARF5 call site-related attributes 2018-10-05 20:37:17 +00:00
DwarfDebug.cpp [DebugInfo] Add support for DWARF5 call site-related attributes 2018-10-05 20:37:17 +00:00
DwarfDebug.h [DebugInfo] Add support for DWARF5 call site-related attributes 2018-10-05 20:37:17 +00:00
DwarfException.h Use assembler expressions to lay out the EH LSDA. 2018-02-09 17:00:25 +00:00
DwarfExpression.cpp [DebugInfo] Normalize common kinds of DWARF sub-expressions. 2018-09-05 10:18:36 +00:00
DwarfExpression.h [DebugInfo] Normalize common kinds of DWARF sub-expressions. 2018-09-05 10:18:36 +00:00
DwarfFile.cpp [DebugInfo] Generate DWARF debug information for labels. (Fix leak problems) 2018-08-17 15:22:04 +00:00
DwarfFile.h [DebugInfo] Generate DWARF debug information for labels. (Fix leak problems) 2018-08-17 15:22:04 +00:00
DwarfStringPool.cpp Use the container form llvm::sort(C, ...) 2018-09-30 22:31:29 +00:00
DwarfStringPool.h [DebugInfo] Reduce debug_str_offsets section size 2018-08-07 09:54:52 +00:00
DwarfUnit.cpp [DWARF] - Emit the correct value for DW_AT_addr_base. 2018-09-20 09:17:36 +00:00
DwarfUnit.h [DWARF] - Emit the correct value for DW_AT_addr_base. 2018-09-20 09:17:36 +00:00
EHStreamer.cpp Make meanings of variables clearer in action table generation (NFC) 2018-10-03 21:30:15 +00:00
EHStreamer.h [CodeGen] Fix inconsistent declaration parameter name 2018-07-16 18:51:40 +00:00
ErlangGCPrinter.cpp Style update. NFC. 2018-03-29 23:32:54 +00:00
LLVMBuild.txt Update libdeps to add BinaryFormat, introduced in r304864. 2017-06-07 04:48:49 +00:00
OcamlGCPrinter.cpp Style update. NFC. 2018-03-29 23:32:54 +00:00
WinCFGuard.cpp Reland "Emit Function IDs table for Control Flow Guard" 2018-01-09 23:49:30 +00:00
WinCFGuard.h Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00
WinException.cpp Move TargetLoweringObjectFile from CodeGen to Target to fix layering 2018-03-23 23:58:19 +00:00
WinException.h Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00