[Lldb-commits] [PATCH] D43886: [lldb] Add GetCurrentException and GetCurrentExceptionBacktrace APIs to SBThread

Jim Ingham via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Mar 1 11:09:52 PST 2018


jingham added a comment.

I have a couple of structural questions.

First, it would be good to stop a bit and think about how to make the StackFrameRecognizer's return data more flexible.  At some point, for instance, it would be great to be able to add a StackFrameRecognizerPython and then let people add their own plugins to handle special data from functions they know about in their code.  Basically DataFormatters for functions on the stack.  But if the way you get data out of a Recognizer is to call specific functions on the recognizer, then you're going to have to enumerate up front all the kinds of data a recognizer can provide, which will make this harder.

It seems however like providing some interesting ValueObjects is a pretty common thing to do, so maybe it would be better to have an API like:

ValueObjectSP GetValueObjectOfKind(const char *kind);

in which case you probably also want:

GetSupportedKinds()

that returns some kind of string list so you could anonymously print all the interesting information.

I actually like having a command to get the current exception (and it's backtrace) for a thread.  We do an analogous thing when listing the queue that launched the current thread (and the backtrace when dispatched) with:

thread backtrace -e true

So now we have two very different ways to do analogous things.  Maybe it would be better to change --extended to take an enum, and then do:

thread backtrace --extended queues

or

thread backtrace --extended exception


https://reviews.llvm.org/D43886





More information about the lldb-commits mailing list