[Lldb-commits] [lldb] a5a6c03 - [lldb/crashlog] Fix crash when loading non-symbolicated report

Med Ismail Bennani via lldb-commits lldb-commits at lists.llvm.org
Thu Jun 1 17:11:12 PDT 2023


Author: Med Ismail Bennani
Date: 2023-06-01T17:10:57-07:00
New Revision: a5a6c03c448ba1ab404b58673eef1f7b68498dff

URL: https://github.com/llvm/llvm-project/commit/a5a6c03c448ba1ab404b58673eef1f7b68498dff
DIFF: https://github.com/llvm/llvm-project/commit/a5a6c03c448ba1ab404b58673eef1f7b68498dff.diff

LOG: [lldb/crashlog] Fix crash when loading non-symbolicated report

This patch should address the crashes when parsing a the crash report
frame dictionary.

If the crash report is not symbolicated, the `symbolLocation` key will
be missing. In that case, we should just use the `imageOffset`.

rdar://109836386

Differential Revision: https://reviews.llvm.org/D151844

Signed-off-by: Med Ismail Bennani <ismail at bennani.ma>

Added: 
    

Modified: 
    lldb/examples/python/crashlog.py

Removed: 
    


################################################################################
diff  --git a/lldb/examples/python/crashlog.py b/lldb/examples/python/crashlog.py
index f6505c1f68e21..387f84cca33d4 100755
--- a/lldb/examples/python/crashlog.py
+++ b/lldb/examples/python/crashlog.py
@@ -598,7 +598,9 @@ def parse_frames(self, thread, json_frames):
 
             if "symbol" in json_frame:
                 symbol = json_frame["symbol"]
-                location = int(json_frame["symbolLocation"])
+                location = 0
+                if "symbolLocation" in json_frame and json_frame["symbolLocation"]:
+                    location = int(json_frame["symbolLocation"])
                 image = self.images[image_id]
                 image.symbols[symbol] = {
                     "name": symbol,


        


More information about the lldb-commits mailing list