mib marked an inline comment as done.
mib added inline comments.

================
Comment at: lldb/examples/python/crashlog.py:1023-1024
+
+    async_state = debugger.GetAsync()
+    debugger.SetAsync(False)
+
----------------
JDevlieghere wrote:
>  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): 
>   ...
> ```
TIL, very cool!


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