summaryrefslogtreecommitdiffstats
path: root/lldb/source/API/SBThread.cpp
diff options
context:
space:
mode:
authorKuba Mracek <mracek@apple.com>2018-12-20 02:01:59 +0000
committerKuba Mracek <mracek@apple.com>2018-12-20 02:01:59 +0000
commitc9e1190a27864868324c20aabd8fa648a8247c5a (patch)
tree9c4c52e8ff57572eb2db84a2ea0a2e6b2869b105 /lldb/source/API/SBThread.cpp
parent17e705129eeffdefe148ecafdd0268ba463ac876 (diff)
downloadbcm5719-llvm-c9e1190a27864868324c20aabd8fa648a8247c5a.tar.gz
bcm5719-llvm-c9e1190a27864868324c20aabd8fa648a8247c5a.zip
[lldb] Retrieve currently handled Obj-C exception via __cxa_current_exception_type and add GetCurrentExceptionBacktrace SB ABI
This builds on https://reviews.llvm.org/D43884 and https://reviews.llvm.org/D43886 and extends LLDB support of Obj-C exceptions to also look for a "current exception" for a thread in the C++ exception handling runtime metadata (via call to __cxa_current_exception_type). We also construct an actual historical SBThread/ThreadSP that contains frames from the backtrace in the Obj-C exception object. The high level goal this achieves is that when we're already crashed (because an unhandled exception occurred), we can still access the exception object and retrieve the backtrace from the throw point. In Obj-C, this is particularly useful because a catch+rethrow is very common and in those cases you currently don't have any access to the throw point backtrace. Differential Revision: https://reviews.llvm.org/D44072 llvm-svn: 349718
Diffstat (limited to 'lldb/source/API/SBThread.cpp')
-rw-r--r--lldb/source/API/SBThread.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/lldb/source/API/SBThread.cpp b/lldb/source/API/SBThread.cpp
index 97a9df62566..2c859d5222d 100644
--- a/lldb/source/API/SBThread.cpp
+++ b/lldb/source/API/SBThread.cpp
@@ -1491,13 +1491,12 @@ SBValue SBThread::GetCurrentException() {
return SBValue(thread_sp->GetCurrentException());
}
-/* TODO(kubamracek)
SBThread SBThread::GetCurrentExceptionBacktrace() {
ThreadSP thread_sp(m_opaque_sp->GetThreadSP());
if (!thread_sp) return SBThread();
return SBThread(thread_sp->GetCurrentExceptionBacktrace());
-}*/
+}
bool SBThread::SafeToCallFunctions() {
ThreadSP thread_sp(m_opaque_sp->GetThreadSP());
OpenPOWER on IntegriCloud