[Lldb-commits] [lldb] 2cbd3b0 - [lldb] Support "absolute memory address" images in crashlog.py

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Mon Apr 19 10:27:18 PDT 2021


Author: Jonas Devlieghere
Date: 2021-04-19T10:27:11-07:00
New Revision: 2cbd3b04feaaaff7fab4c6500476839a23180886

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

LOG: [lldb] Support "absolute memory address" images in crashlog.py

The binary image list contains the following entry when a frame is not
found in any know binary image:

  {
    "size" : 0,
    "source" : "A",
    "base" : 0,
    "uuid" : "00000000-0000-0000-0000-000000000000"
  }

Note that this object is missing the name and path keys. This patch
makes the JSON parser resilient against their absence.

Added: 
    

Modified: 
    lldb/examples/python/crashlog.py

Removed: 
    


################################################################################
diff  --git a/lldb/examples/python/crashlog.py b/lldb/examples/python/crashlog.py
index afae31f4a3620..1f26739f60e16 100755
--- a/lldb/examples/python/crashlog.py
+++ b/lldb/examples/python/crashlog.py
@@ -452,9 +452,9 @@ def parse_images(self, json_images):
             img_uuid = uuid.UUID(json_image['uuid'])
             low = int(json_image['base'])
             high = int(0)
-            name = json_image['name']
-            path = json_image['path']
-            version = ""
+            name = json_image['name'] if 'name' in json_image else ''
+            path = json_image['path'] if 'path' in json_image else ''
+            version = ''
             darwin_image = self.crashlog.DarwinImage(low, high, name, version,
                                                      img_uuid, path,
                                                      self.verbose)


        


More information about the lldb-commits mailing list