[Lldb-commits] [PATCH] D131033: [lldb/crashlog] Fix parsing issue with `procPath`

Med Ismail Bennani via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Aug 3 16:23:12 PDT 2022


mib added inline comments.


================
Comment at: lldb/examples/python/crashlog.py:473
+        if 'procPath' in json_data:
+            self.crashlog.process_path = json_data['procPath']
 
----------------
JDevlieghere wrote:
> mib wrote:
> > aprantl wrote:
> > > Is it now undefined if it doesn't exist? Does that cause an exception when we try to access it?
> > > Is there anything special about procPath, or should all the JSON keys be optional like this?
> > > i.e., is there a `json_data.readOrDefault(key, default_value)` method?
> > `process_path` is actually not used in `crashlog.py` at all. Since it can be missing in some crash reports, we need to parse it only when it's available, otherwise we get the following error which causes the crashlog script to stop:
> > 
> > ```
> > error: python exception: Failed to parse JSON crashlog: KeyError: 'procPath'
> > ```
> If it's not used, should we just remove it altogether?
Sure! Since we symbolicate the crashlogs by fetching the used binaries UUIDs, I think it's reasonable to get rid of everything related the `procPath`


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

https://reviews.llvm.org/D131033



More information about the lldb-commits mailing list