[lldb] Adjust parse_frames for unnamed images
authorJonas Devlieghere <jonas@devlieghere.com>
Fri, 3 Sep 2021 20:23:03 +0000 (13:23 -0700)
committerJonas Devlieghere <jonas@devlieghere.com>
Fri, 3 Sep 2021 20:23:24 +0000 (13:23 -0700)
Follow up to 2cbd3b04feaaaff7fab4c6500476839a23180886 which added
support for unnamed images but missed the use case in parse_frames.

lldb/examples/python/crashlog.py

index a7b2d3b..79b290c 100755 (executable)
@@ -473,7 +473,8 @@ class JSONCrashLogParser:
         idx = 0
         for json_frame in json_frames:
             image_id = int(json_frame['imageIndex'])
-            ident = self.get_used_image(image_id)['name']
+            json_image = self.get_used_image(image_id)
+            ident = json_image['name'] if 'name' in json_image else ''
             thread.add_ident(ident)
             if ident not in self.crashlog.idents:
                 self.crashlog.idents.append(ident)