[Lldb-commits] [lldb] [lldb] Expose the Target API lock through the SB API (PR #131404)

Adrian Vogelsgesang via lldb-commits lldb-commits at lists.llvm.org
Thu Mar 20 15:25:24 PDT 2025


================
@@ -0,0 +1,11 @@
+%extend lldb::SBLock {
+#ifdef SWIGPYTHON
+    %pythoncode %{
+        def __enter__(self):
+            return self
+
+        def __exit__(self, exc_type, exc_value, traceback):
+            self.Unlock()
----------------
vogelsgesang wrote:

Sounds good. If we would have an additional `GetLock` (beides `AcquireLock`) which returns the non-locked Lock, then I think we would have a full idiomatoc interface, also in Python

https://github.com/llvm/llvm-project/pull/131404


More information about the lldb-commits mailing list