[Lldb-commits] [PATCH] D91835: [lldb] Add Python bindings to print stack traces on crashes.

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Nov 20 01:09:17 PST 2020


labath added a comment.

In D91835#2407060 <https://reviews.llvm.org/D91835#2407060>, @rupprecht wrote:

> I ran manual tests for this, but I did so by introducing an intentional crash in a place that obviously can't be checked in. Does LLDB have any kind of intentional-crash-for-test mechanism that could be used for a test?

We have a `reproducer xcrash` command that could be used for this purpose.

Though that does bring up the question of how will this interact with reproducers, which also mess with signal handlers. @JDevlieghere, any thoughts on that?

> Also, I picked `SBDebugger` for this as it seems like a very global option, but I'm happy to put it somewhere else. Not sure where though?

SBDebugger is probably fine. That's where we put our other global static functions...



================
Comment at: lldb/packages/Python/lldbsuite/test/dotest.py:883-884
 
+    # Print stack traces from coming from inside lldb.
+    lldb.SBDebugger.PrintStackTraceOnError()
+
----------------
I'm also not sure, but I guess this should be coming after the reproducer initialization code (below).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D91835/new/

https://reviews.llvm.org/D91835



More information about the lldb-commits mailing list