Index: lldb/examples/python/crashlog.py =================================================================== --- lldb/examples/python/crashlog.py +++ lldb/examples/python/crashlog.py @@ -586,10 +586,15 @@ self.parse_threads(self.data["threads"]) if "asi" in self.data: self.crashlog.asi = self.data["asi"] + # FIXME: With the current design, we can either show the ASI or Last + # Exception Backtrace, not both. Is there a situation where we would + # like to show both ? if "asiBacktraces" in self.data: self.parse_app_specific_backtraces(self.data["asiBacktraces"]) if "lastExceptionBacktrace" in self.data: - self.crashlog.asb = self.data["lastExceptionBacktrace"] + self.parse_last_exception_backtraces( + self.data["lastExceptionBacktrace"] + ) self.parse_errors(self.data) thread = self.crashlog.threads[self.crashlog.crashed_thread_idx] reason = self.parse_crash_reason(self.data["exception"]) @@ -792,12 +797,22 @@ return True def parse_app_specific_backtraces(self, json_app_specific_bts): - for idx, backtrace in enumerate(json_app_specific_bts): - thread = self.crashlog.Thread(idx, True, self.crashlog.process_arch) - thread.queue = "Application Specific Backtrace" + thread = self.crashlog.Thread( + len(self.crashlog.threads), True, self.crashlog.process_arch + ) + thread.queue = "Application Specific Backtrace" + for backtrace in json_app_specific_bts: if self.parse_asi_backtrace(thread, backtrace): self.crashlog.threads.append(thread) + def parse_last_exception_backtraces(self, json_last_exc_bts): + thread = self.crashlog.Thread( + len(self.crashlog.threads), True, self.crashlog.process_arch + ) + thread.queue = "Last Exception Backtrace" + self.parse_frames(thread, json_last_exc_bts) + self.crashlog.threads.append(thread) + def parse_thread_registers(self, json_thread_state, prefix=None): registers = dict() for key, state in json_thread_state.items(): 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 @@ -178,7 +178,7 @@ self.idx = self.backing_thread.index self.tid = self.backing_thread.id if self.backing_thread.app_specific_backtrace: - self.name = "Application Specific Backtrace - " + str(self.idx) + self.name = "Application Specific Backtrace" else: self.name = self.backing_thread.name self.queue = self.backing_thread.queue