diff options
author | Kuba Mracek <mracek@apple.com> | 2018-11-28 22:01:52 +0000 |
---|---|---|
committer | Kuba Mracek <mracek@apple.com> | 2018-11-28 22:01:52 +0000 |
commit | e60bc53b4611d98352345e48be4c25214e0bf858 (patch) | |
tree | a608c61b3dd10b4ffc3bb9bd5d48a6bc464218b7 /lldb/source/Target/StackFrameRecognizer.cpp | |
parent | a3e7a167c499bfe35628676137637c5265bb06aa (diff) | |
download | bcm5719-llvm-e60bc53b4611d98352345e48be4c25214e0bf858.tar.gz bcm5719-llvm-e60bc53b4611d98352345e48be4c25214e0bf858.zip |
[lldb] Add GetCurrentException APIs to SBThread, add frame recognizer for objc_exception_throw for Obj-C runtimes
This adds new APIs and a command to deal with exceptions (mostly Obj-C exceptions): SBThread and Thread get GetCurrentException API, which returns an SBValue/ValueObjectSP with the current exception for a thread. "Current" means an exception that is currently being thrown, caught or otherwise processed. In this patch, we only know about the exception when in objc_exception_throw, but subsequent patches will expand this (and add GetCurrentExceptionBacktrace, which will return an SBThread/ThreadSP containing a historical thread backtrace retrieved from the exception object. Currently unimplemented, subsequent patches will implement this).
Extracting the exception from objc_exception_throw is implemented by adding a frame recognizer.
This also add a new sub-command "thread exception", which prints the current exception.
Differential Revision: https://reviews.llvm.org/D43886
llvm-svn: 347813
Diffstat (limited to 'lldb/source/Target/StackFrameRecognizer.cpp')
-rw-r--r-- | lldb/source/Target/StackFrameRecognizer.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lldb/source/Target/StackFrameRecognizer.cpp b/lldb/source/Target/StackFrameRecognizer.cpp index f3f090a2a03..152f4a198e2 100644 --- a/lldb/source/Target/StackFrameRecognizer.cpp +++ b/lldb/source/Target/StackFrameRecognizer.cpp @@ -49,8 +49,9 @@ ScriptedStackFrameRecognizer::RecognizeFrame(lldb::StackFrameSP frame) { class StackFrameRecognizerManagerImpl { public: - void AddRecognizer(StackFrameRecognizerSP recognizer, ConstString &module, - ConstString &symbol, bool first_instruction_only) { + void AddRecognizer(StackFrameRecognizerSP recognizer, + const ConstString &module, const ConstString &symbol, + bool first_instruction_only) { m_recognizers.push_front({(uint32_t)m_recognizers.size(), false, recognizer, false, module, RegularExpressionSP(), symbol, RegularExpressionSP(), first_instruction_only}); @@ -152,8 +153,8 @@ StackFrameRecognizerManagerImpl &GetStackFrameRecognizerManagerImpl() { } void StackFrameRecognizerManager::AddRecognizer( - StackFrameRecognizerSP recognizer, ConstString &module, ConstString &symbol, - bool first_instruction_only) { + StackFrameRecognizerSP recognizer, const ConstString &module, + const ConstString &symbol, bool first_instruction_only) { GetStackFrameRecognizerManagerImpl().AddRecognizer(recognizer, module, symbol, first_instruction_only); } |