[Lldb-commits] [PATCH] D125716: [lldb] Prevent Overflow (Underflow) error in crashlog.py
Jonas Devlieghere via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Mon May 16 15:00:45 PDT 2022
This revision was automatically updated to reflect the committed changes.
Closed by commit rG9defb3b4b4a3: [lldb] Prevent underflow in crashlog.py (authored by JDevlieghere).
Herald added a project: LLDB.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D125716/new/
https://reviews.llvm.org/D125716
Files:
lldb/examples/python/crashlog.py
Index: lldb/examples/python/crashlog.py
===================================================================
--- lldb/examples/python/crashlog.py
+++ lldb/examples/python/crashlog.py
@@ -114,14 +114,12 @@
for frame_idx, frame in enumerate(self.frames):
disassemble = (
this_thread_crashed or options.disassemble_all_threads) and frame_idx < options.disassemble_depth
- if frame_idx == 0:
- symbolicated_frame_addresses = crash_log.symbolicate(
- frame.pc & crash_log.addr_mask, options.verbose)
- else:
- # Any frame above frame zero and we have to subtract one to
- # get the previous line entry
- symbolicated_frame_addresses = crash_log.symbolicate(
- (frame.pc & crash_log.addr_mask) - 1, options.verbose)
+
+ # Any frame above frame zero and we have to subtract one to
+ # get the previous line entry.
+ pc = frame.pc & crash_log.addr_mask
+ pc = pc if frame_idx == 0 or pc == 0 else pc - 1
+ symbolicated_frame_addresses = crash_log.symbolicate(pc, options.verbose)
if symbolicated_frame_addresses:
symbolicated_frame_address_idx = 0
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D125716.429870.patch
Type: text/x-patch
Size: 1357 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20220516/2acd33ed/attachment.bin>
More information about the lldb-commits
mailing list