JDevlieghere added inline comments.

================
Comment at: lldb/examples/python/crashlog.py:1165-1168
+        if os.path.isdir(obj_dir.name):
+            for file in os.listdir(obj_dir.name):
+                os.unlink(os.path.join(obj_dir.name, file))
+            os.rmdir(obj_dir.name)
----------------
Can you call `obj_dir.cleanup()`, or better, can you wrap this in a `with 
tempfile.TemporaryDirectory() as obj_dir:`?


================
Comment at: 
lldb/examples/python/scripted_process/crashlog_scripted_process.py:41
 
+        obj_dir = tempfile.TemporaryDirectory()
         for image in self.crashlog.images:
----------------
Same comment/question here.


================
Comment at: lldb/examples/python/symbolication.py:371
 
-    def add_module(self, target):
+    def add_module(self, target, obj_dir=tempfile.TemporaryDirectory()):
         '''Add the Image described in this object to "target" and load the 
sections if "load" is True.'''
----------------
If the `obj_dir` is created this way, it will never be removed. Is anyone 
relying on the default argument? If not I would make it `None` and change the 
check on line 387 to `if obj_dir:`. 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D151045

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

Reply via email to