[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
Tue Aug 2 16:45:32 PDT 2022


mib created this revision.
mib added a reviewer: JDevlieghere.
mib added a project: LLDB.
Herald added a project: All.
mib requested review of this revision.
Herald added a subscriber: lldb-commits.

This patch checks that the `procPath` key exists in the crashlog data
before using it. In can happen when creating stackshot crash report that
that key is missing.

rdar://95054188

Signed-off-by: Med Ismail Bennani <medismail.bennani at gmail.com>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D131033

Files:
  lldb/examples/python/crashlog.py


Index: lldb/examples/python/crashlog.py
===================================================================
--- lldb/examples/python/crashlog.py
+++ lldb/examples/python/crashlog.py
@@ -469,7 +469,8 @@
     def parse_process_info(self, json_data):
         self.crashlog.process_id = json_data['pid']
         self.crashlog.process_identifier = json_data['procName']
-        self.crashlog.process_path = json_data['procPath']
+        if 'procPath' in json_data:
+            self.crashlog.process_path = json_data['procPath']
 
     def parse_crash_reason(self, json_exception):
         exception_type = json_exception['type']


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D131033.449482.patch
Type: text/x-patch
Size: 630 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20220802/78eaf5f8/attachment.bin>


More information about the lldb-commits mailing list