Skip to content

Commit 6f609b0

Browse files
committed
[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 <[email protected]>
1 parent c8e31f7 commit 6f609b0

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lldb/examples/python/crashlog.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -545,9 +545,11 @@ def parse_frames(self, thread, json_frames):
545545
image_addr = self.get_used_image(image_id)['base']
546546
pc = image_addr + frame_offset
547547

548-
if 'symbol' in json_frame:
549-
symbol = json_frame['symbol']
550-
location = int(json_frame['symbolLocation'])
548+
if "symbol" in json_frame:
549+
symbol = json_frame["symbol"]
550+
location = 0
551+
if "symbolLocation" in json_frame and json_frame["symbolLocation"]:
552+
location = int(json_frame["symbolLocation"])
551553
image = self.images[image_id]
552554
image.symbols[symbol] = {
553555
"name": symbol,

0 commit comments

Comments
 (0)