diff options
author | Vedant Kumar <vsk@apple.com> | 2018-10-05 23:23:15 +0000 |
---|---|---|
committer | Vedant Kumar <vsk@apple.com> | 2018-10-05 23:23:15 +0000 |
commit | 4b36f7911d8d186b60c1c63b5680e7a7ab300b61 (patch) | |
tree | 3c400746ca753e0c54c091d023bd9249c1c360d3 /lldb/source/API/SBFrame.cpp | |
parent | 9d9c9655443cf8810390f525312d8ce70c4d319b (diff) | |
download | bcm5719-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/API/SBFrame.cpp')
-rw-r--r-- | lldb/source/API/SBFrame.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lldb/source/API/SBFrame.cpp b/lldb/source/API/SBFrame.cpp index 05e629cbafa..b1c9cb62fa9 100644 --- a/lldb/source/API/SBFrame.cpp +++ b/lldb/source/API/SBFrame.cpp @@ -1348,6 +1348,21 @@ bool SBFrame::IsInlined() const { return false; } +bool SBFrame::IsArtificial() { + return static_cast<const SBFrame *>(this)->IsArtificial(); +} + +bool SBFrame::IsArtificial() const { + std::unique_lock<std::recursive_mutex> lock; + ExecutionContext exe_ctx(m_opaque_sp.get(), lock); + + StackFrame *frame = exe_ctx.GetFramePtr(); + if (frame) + return frame->IsArtificial(); + + return false; +} + const char *SBFrame::GetFunctionName() { return static_cast<const SBFrame *>(this)->GetFunctionName(); } |