JDevlieghere added a comment.

LGTM. I left a comment with a suggestion for a context manager but that's up to 
you.



================
Comment at: lldb/examples/python/crashlog.py:1023-1024
+
+    async_state = debugger.GetAsync()
+    debugger.SetAsync(False)
+
----------------
 This is the perfect pattern for a context manager:

```
@contextlib.contextmanager
def synchronous(debugger):
    async = debugger.GetAsync()
    debugger.SetAsync(False)
    try:
        yield
    finally:
        debugger.SetAsync(async)
```
and then you can do:

```
with synchronous(debugger): 
  ...
```


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

https://reviews.llvm.org/D121038

_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to