Index: lldb/examples/python/crashlog.py =================================================================== --- lldb/examples/python/crashlog.py +++ lldb/examples/python/crashlog.py @@ -115,8 +115,8 @@ 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. + # We should substract 1 to every frame's pc above frame zero + # 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) Index: lldb/examples/python/scripted_process/crashlog_scripted_process.py =================================================================== --- lldb/examples/python/scripted_process/crashlog_scripted_process.py +++ lldb/examples/python/scripted_process/crashlog_scripted_process.py @@ -16,6 +16,7 @@ return self.pid = crash_log.process_id + self.addr_mask = crash_log.addr_mask self.crashed_thread_idx = crash_log.crashed_thread_idx self.loaded_images = [] @@ -122,11 +123,13 @@ return None for frame in self.backing_thread.frames: + frame_pc = frame.pc & self.scripted_process.addr_mask + pc = frame_pc if frame.index == 0 or frame_pc == 0 else frame_pc - 1 sym_addr = lldb.SBAddress() - sym_addr.SetLoadAddress(frame.pc, self.target) + sym_addr.SetLoadAddress(pc, self.target) if not sym_addr.IsValid(): continue - self.frames.append({"idx": frame.index, "pc": frame.pc}) + self.frames.append({"idx": frame.index, "pc": pc}) return self.frames