[lldb/Target] Add Assert StackFrame Recognizer
authorMed Ismail Bennani <medismail.bennani@gmail.com>
Thu, 23 Jan 2020 14:11:53 +0000 (15:11 +0100)
committerMed Ismail Bennani <medismail.bennani@gmail.com>
Tue, 28 Jan 2020 17:21:29 +0000 (18:21 +0100)
commit03a6b858fde5c644ec16b1fddd8e10aa9ef3f0ad
treeb28dcf032fd397b646789512e937c9fcf812a378
parent7f93ff58e1bfbfdbb91a4be5271f9f880016e950
[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]