[lldb] Add Python bindings to print stack traces on crashes.
authorJonas Devlieghere <jonas@devlieghere.com>
Thu, 7 Apr 2022 18:12:09 +0000 (11:12 -0700)
committerJonas Devlieghere <jonas@devlieghere.com>
Thu, 7 Apr 2022 18:21:02 +0000 (11:21 -0700)
commitee2d9b8723561fb6a81b9c2c4fd7a93300c6154f
tree3b2621c0e438d0e5b3ded515942df08d4bfcc965
parent50de659adcc19c4c197ba5e9a7719325af7151ee
[lldb] Add Python bindings to print stack traces on crashes.

As noticed in D87637, when LLDB crashes, we only print stack traces if
LLDB is directly executed, not when used via Python bindings. Enabling
this by default may be undesirable (libraries shouldn't be messing with
signal handlers), so make this an explicit opt-in.

I "commandeered" this patch from Jordan Rupprecht who put this up for
review originally.

Differential revision: https://reviews.llvm.org/D91835
lldb/bindings/interface/SBDebugger.i
lldb/include/lldb/API/SBDebugger.h
lldb/packages/Python/lldbsuite/test/dotest.py
lldb/source/API/SBDebugger.cpp