[lldb/Target] Add Assert StackFrame Recognizer
authorMed Ismail Bennani <medismail.bennani@gmail.com>
Tue, 4 Feb 2020 16:53:26 +0000 (17:53 +0100)
committerMed Ismail Bennani <medismail.bennani@gmail.com>
Thu, 6 Feb 2020 17:27:48 +0000 (18:27 +0100)
commit7ebe9cc4fc2d97ec0ed2a6038be25b2a7ed1aac2
tree878a70fc600570423384298f7b8fb029c897b1f7
parent318d0ede572080f18d0106dbc354e11c88329a84
[lldb/Target] Add Assert StackFrame Recognizer

When a thread stops, this checks depending on the platform if the top frame is
an abort stack frame. If so, it looks for an assert stack frame in the upper
frames and set it as the most relavant frame when found.

To do so, the StackFrameRecognizer class holds a "Most Relevant Frame" and a
"cooked" stop reason description. When the thread is about to stop, it checks
if the current frame is recognized, and if so, it fetches the recognized frame's
attributes and applies them.

rdar://58528686

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

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
17 files changed:
lldb/docs/use/formatting.rst
lldb/include/lldb/Core/FormatEntity.h
lldb/include/lldb/Target/AssertFrameRecognizer.h [new file with mode: 0644]
lldb/include/lldb/Target/StackFrameRecognizer.h
lldb/include/lldb/Target/Thread.h
lldb/packages/Python/lldbsuite/test/functionalities/inferior-assert/TestInferiorAssert.py
lldb/packages/Python/lldbsuite/test/lang/objc/exceptions/TestObjCExceptions.py
lldb/source/API/SBThread.cpp
lldb/source/Core/FormatEntity.cpp
lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
lldb/source/Target/AssertFrameRecognizer.cpp [new file with mode: 0644]
lldb/source/Target/CMakeLists.txt
lldb/source/Target/Process.cpp
lldb/source/Target/StackFrameRecognizer.cpp
lldb/source/Target/Thread.cpp
lldb/test/Shell/Recognizer/Inputs/assert.c [new file with mode: 0644]
lldb/test/Shell/Recognizer/assert.test [new file with mode: 0644]