aboutsummaryrefslogtreecommitdiff
path: root/lldb/examples/python/crashlog.py
diff options
context:
space:
mode:
authorMed Ismail Bennani <medismail.bennani@gmail.com>2022-05-18 14:18:14 -0700
committerMed Ismail Bennani <medismail.bennani@gmail.com>2022-05-18 18:22:47 -0700
commit3e54ea0cfa3074e36ebee11848e072785437a8b9 (patch)
tree2b7beaf77e198930a9d9f92df190af72ff39258b /lldb/examples/python/crashlog.py
parent051a5ae99824fab879d9aade9d794e60ebc5c2e5 (diff)
downloadllvm-3e54ea0cfa3074e36ebee11848e072785437a8b9.zip
llvm-3e54ea0cfa3074e36ebee11848e072785437a8b9.tar.gz
llvm-3e54ea0cfa3074e36ebee11848e072785437a8b9.tar.bz2
[lldb/crashlog] Fix line entries resolution in interactive mode
This patch subtracts 1 to the pc of any frame above frame 0 to get the previous line entry and display the right line in the debugger. This also rephrase some old comment from `48d157dd4`. rdar://92686666 Differential Revision: https://reviews.llvm.org/D125928 Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
Diffstat (limited to 'lldb/examples/python/crashlog.py')
-rwxr-xr-xlldb/examples/python/crashlog.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/lldb/examples/python/crashlog.py b/lldb/examples/python/crashlog.py
index a20798a..b214576 100755
--- a/lldb/examples/python/crashlog.py
+++ b/lldb/examples/python/crashlog.py
@@ -115,8 +115,8 @@ class CrashLog(symbolication.Symbolicator):
disassemble = (
this_thread_crashed or options.disassemble_all_threads) and frame_idx < options.disassemble_depth
- # Any frame above frame zero and we have to subtract one to
- # get the previous line entry.
+ # Except for the zeroth frame, we should subtract 1 from every
+ # frame pc 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)