[Lldb-commits] [PATCH] D139951: [lldb/crashlog] Refactor CrashLogParser into a Factory patern
Jonas Devlieghere via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Tue Dec 13 11:49:16 PST 2022
JDevlieghere added inline comments.
================
Comment at: lldb/examples/python/crashlog.py:419-426
+def CrashLogParserFactory(debugger, path, verbose):
+ data = JSONCrashLogParser.is_valid_json(path)
+ if data:
+ parser = JSONCrashLogParser(debugger, path, verbose)
+ parser.data = data
+ return parser
+ else:
----------------
This looks like a class now. The common patter for a factory is to create a static method (e.g. `create`) in the class you're instantiating.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D139951/new/
https://reviews.llvm.org/D139951
More information about the lldb-commits
mailing list