[Lldb-commits] [lldb] [lldb] Introduce ScriptedFrameProvider for real threads (PR #161870)
Med Ismail Bennani via lldb-commits
lldb-commits at lists.llvm.org
Tue Oct 7 04:31:13 PDT 2025
================
@@ -0,0 +1,147 @@
+from abc import ABCMeta, abstractmethod
+
+import lldb
+
+
+class ScriptedFrameProvider(metaclass=ABCMeta):
+ """
+ The base class for a scripted frame provider.
+
+ A scripted frame provider allows you to provide custom stack frames for a
+ thread, which can be used to augment or replace the standard unwinding
+ mechanism. This is useful for:
+
+ - Providing frames for custom calling conventions or languages
+ - Reconstructing missing frames from crash dumps or core files
+ - Adding diagnostic or synthetic frames for debugging
+ - Visualizing state machines or async execution contexts
+
+ Most of the base class methods are `@abstractmethod` that need to be
+ overwritten by the inheriting class.
+
+ Example usage:
+
+ .. code-block:: python
+
+ # Attach a frame provider to a thread
+ thread = process.GetSelectedThread()
+ error = lldb.SBError()
----------------
medismailben wrote:
Good catch, it's actually the return value of `SBThread::SetScriptedFrameProvider`. I'll update the doc.
https://github.com/llvm/llvm-project/pull/161870
More information about the lldb-commits
mailing list