[Lldb-commits] [PATCH] D131085: [lldb/crashlog] Refactor the CrashLogParser logic

Dave Lee via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Aug 3 11:20:26 PDT 2022


kastiglione added inline comments.


================
Comment at: lldb/examples/python/crashlog.py:418-422
+    def __new__(cls, debugger, path, verbose, *args, **kwargs):
         try:
-            return JSONCrashLogParser(debugger, path, verbose).parse()
+            return super(CrashLogParser, cls).__new__(JSONCrashLogParser, *args, **kwargs)
         except CrashLogFormatException:
+            return super(CrashLogParser, cls).__new__(TextCrashLogParser, *args, **kwargs)
----------------
It looks like `debugger, path, verbose` are not propagated to the `CrashLogParser` subclass, is this an oversight or is there some magic? Secondly, `args` and `kwargs` used/needed?


================
Comment at: lldb/examples/python/scripted_process/crashlog_scripted_process.py:16-17
+            crashlog = crashlog_parser.parse()
         except Exception as e:
             raise e
 
----------------
Is this catch and re-raise of any use? Since you're refactoring, maybe delete it?


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

https://reviews.llvm.org/D131085



More information about the lldb-commits mailing list