[Lldb-commits] [PATCH] D44072: [lldb] Retrieve currently handled Obj-C exception via __cxa_current_exception_type

Kuba (Brecka) Mracek via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Sat Mar 3 11:36:30 PST 2018


kubamracek created this revision.
kubamracek added reviewers: jingham, jasonmolenda, davide.

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 in very common and in those cases you currently don't have any access to the throw point backtrace.

This is WIP, as the patch is missing doc-comments, error handling, but I'm looking for early comments to the approach.


https://reviews.llvm.org/D44072

Files:
  include/lldb/Target/SystemRuntime.h
  packages/Python/lldbsuite/test/lang/objc/exceptions/TestObjCExceptions.py
  packages/Python/lldbsuite/test/lang/objc/exceptions/main.m
  scripts/interface/SBThread.i
  source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp
  source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.h
  source/Target/Thread.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D44072.136928.patch
Type: text/x-patch
Size: 11376 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20180303/ea3a6a77/attachment-0001.bin>


More information about the lldb-commits mailing list