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.benn...@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']


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']
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to