llvm-project/llvm/lib/DebugInfo/DWARF
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
..
CMakeLists.txt Revert "[DWARF] reposting r342048, which was reverted in r342056 due to buildbot errors. Adjusted 2 test cases for ARM and darwin and fixed a bug with the original change in dsymutil." 2018-09-17 15:40:01 +00:00
DWARFAbbreviationDeclaration.cpp Remove trailing space 2018-07-30 19:41:25 +00:00
DWARFAcceleratorTable.cpp [DWARF] Refactor DWARF classes to use unified error reporting. NFC. 2018-08-20 09:59:08 +00:00
DWARFAddressRange.cpp [DWARF v5] Support for verbose dumping of .debug_rnglist entries 2018-03-08 20:52:35 +00:00
DWARFCompileUnit.cpp [DWARFv5] Put the DWO ID in its place. 2018-05-22 17:27:31 +00:00
DWARFContext.cpp Revert r343317 2018-09-28 17:01:50 +00:00
DWARFDataExtractor.cpp Reland "[DebugInfo] Support DWARF expressions in eh_frame" 2018-03-08 00:46:53 +00:00
DWARFDebugAbbrev.cpp dwarfdump: Delay parsing abbreviations until they're needed 2017-09-19 15:13:55 +00:00
DWARFDebugAddr.cpp [DWARF] Support for .debug_addr (consumer) 2018-07-31 22:19:19 +00:00
DWARFDebugArangeSet.cpp [DebugInfo] Unify dumping of address ranges 2018-01-16 11:17:57 +00:00
DWARFDebugAranges.cpp llvm::sort(C.begin(), C.end(), ...) -> llvm::sort(C, ...) 2018-09-27 02:13:45 +00:00
DWARFDebugFrame.cpp Revert r343317 2018-09-28 17:01:50 +00:00
DWARFDebugInfoEntry.cpp [DWARF] NFC: DWARFDataExtractor combines relocs with DataExtractor. 2017-06-29 16:52:08 +00:00
DWARFDebugLine.cpp llvm::sort(C.begin(), C.end(), ...) -> llvm::sort(C, ...) 2018-09-27 02:13:45 +00:00
DWARFDebugLoc.cpp [DebugInfo] Use absolute addresses in location lists 2018-05-21 19:36:54 +00:00
DWARFDebugMacro.cpp [Support] Move syntax highlighting into support 2018-03-09 09:56:24 +00:00
DWARFDebugPubTable.cpp Use StringRef instead of `const char *`. 2018-07-09 22:26:49 +00:00
DWARFDebugRangeList.cpp Revert "[DWARF] reposting r342048, which was reverted in r342056 due to buildbot errors. Adjusted 2 test cases for ARM and darwin and fixed a bug with the original change in dsymutil." 2018-09-17 15:40:01 +00:00
DWARFDebugRnglists.cpp Revert "[DWARF] reposting r342048, which was reverted in r342056 due to buildbot errors. Adjusted 2 test cases for ARM and darwin and fixed a bug with the original change in dsymutil." 2018-09-17 15:40:01 +00:00
DWARFDie.cpp Revert "[DWARF] reposting r342048, which was reverted in r342056 due to buildbot errors. Adjusted 2 test cases for ARM and darwin and fixed a bug with the original change in dsymutil." 2018-09-17 15:40:01 +00:00
DWARFExpression.cpp Reland "[DebugInfo] Support DWARF expressions in eh_frame" 2018-03-08 00:46:53 +00:00
DWARFFormValue.cpp [dwarfdump] Improve -diff option by hiding more data. 2018-09-04 16:21:37 +00:00
DWARFGdbIndex.cpp Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
DWARFListTable.cpp Revert "[DWARF] reposting r342048, which was reverted in r342056 due to buildbot errors. Adjusted 2 test cases for ARM and darwin and fixed a bug with the original change in dsymutil." 2018-09-17 15:40:01 +00:00
DWARFTypeUnit.cpp [DWARF] Factor out a DWARFUnitHeader class. NFC 2018-05-14 20:32:31 +00:00
DWARFUnit.cpp [dwarfdump] Verify compatibility of attribute TAGs. 2018-09-21 07:49:29 +00:00
DWARFUnitIndex.cpp Fix unused variable warning. NFCI. 2018-09-13 10:54:23 +00:00
DWARFVerifier.cpp [DebugInfo] Add support for DWARF5 call site-related attributes 2018-10-05 20:37:17 +00:00
LLVMBuild.txt [dwarfdump] Pretty print location expressions and location lists 2017-08-29 21:41:21 +00:00