summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/Debugger.cpp
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2018-10-05 23:23:15 +0000
committerVedant Kumar <vsk@apple.com>2018-10-05 23:23:15 +0000
commit4b36f7911d8d186b60c1c63b5680e7a7ab300b61 (patch)
tree3c400746ca753e0c54c091d023bd9249c1c360d3 /lldb/source/Core/Debugger.cpp
parent9d9c9655443cf8810390f525312d8ce70c4d319b (diff)
downloadbcm5719-llvm-4b36f7911d8d186b60c1c63b5680e7a7ab300b61.tar.gz
bcm5719-llvm-4b36f7911d8d186b60c1c63b5680e7a7ab300b61.zip
Add support for artificial tail call frames
This patch teaches lldb to detect when there are missing frames in a backtrace due to a sequence of tail calls, and to fill in the backtrace with artificial tail call frames when this happens. This is only done when the execution history can be determined from the call graph and from the return PC addresses of calls on the stack. Ambiguous sequences of tail calls (e.g anything involving tail calls and recursion) are detected and ignored. Depends on D49887. Differential Revision: https://reviews.llvm.org/D50478 llvm-svn: 343900
Diffstat (limited to 'lldb/source/Core/Debugger.cpp')
-rw-r--r--lldb/source/Core/Debugger.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lldb/source/Core/Debugger.cpp b/lldb/source/Core/Debugger.cpp
index 1c2d69cb58a..be72ac0b16e 100644
--- a/lldb/source/Core/Debugger.cpp
+++ b/lldb/source/Core/Debugger.cpp
@@ -123,6 +123,8 @@ static constexpr OptionEnumValueElement g_language_enumerators[] = {
"{ at ${line.file.basename}:${line.number}{:${line.column}}}"
#define IS_OPTIMIZED "{${function.is-optimized} [opt]}"
+#define IS_ARTIFICIAL "{${frame.is-artificial} [artificial]}"
+
#define DEFAULT_THREAD_FORMAT \
"thread #${thread.index}: tid = ${thread.id%tid}" \
"{, ${frame.pc}}" MODULE_WITH_FUNC FILE_AND_LINE \
@@ -147,11 +149,11 @@ static constexpr OptionEnumValueElement g_language_enumerators[] = {
#define DEFAULT_FRAME_FORMAT \
"frame #${frame.index}: ${frame.pc}" MODULE_WITH_FUNC FILE_AND_LINE \
- IS_OPTIMIZED "\\n"
+ IS_OPTIMIZED IS_ARTIFICIAL "\\n"
#define DEFAULT_FRAME_FORMAT_NO_ARGS \
"frame #${frame.index}: ${frame.pc}" MODULE_WITH_FUNC_NO_ARGS FILE_AND_LINE \
- IS_OPTIMIZED "\\n"
+ IS_OPTIMIZED IS_ARTIFICIAL "\\n"
// Three parts to this disassembly format specification:
// 1. If this is a new function/symbol (no previous symbol/function), print
OpenPOWER on IntegriCloud