Skip to content

Commit 9a44eed

Browse files
committed
[lldb/crashlog] Skip non-crashed threads in batch mode
When using the `crashlog` command in batch mode, most users only care about the crashed thread and end up having to scroll past all the non-crashed threads, which is not a good user experience. Now that `-c|--crashed-only` is set by default, we should also apply that behavior for batch mode: Only the crashed thread and "Application Specific Backtrace" threads will be shown to the user in batch mode. The user will still have the ability to show all the threads if they use `--no-crashed-only` which will parse the symbols from the report, or with `-a|--load-all-images` which will fetch binaries and debug info from the build record and symbolicate every thread. rdar://106329893 Differential Revision: https://reviews.llvm.org/D157852 Signed-off-by: Med Ismail Bennani <[email protected]>
1 parent 4c4f0d8 commit 9a44eed

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lldb/examples/python/crashlog.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -949,6 +949,7 @@ def parse(self):
949949
self.thread.reason += (
950950
" (%s)" % self.crashlog.thread_exception_data
951951
)
952+
self.thread.crashed = True
952953
if self.app_specific_backtrace:
953954
self.crashlog.backtraces.append(self.thread)
954955
else:
@@ -1437,6 +1438,10 @@ def add_module(image, target, obj_dir):
14371438
print()
14381439

14391440
for thread in crash_log.threads:
1441+
if options.crashed_only and not (
1442+
thread.crashed or thread.app_specific_backtrace
1443+
):
1444+
continue
14401445
thread.dump_symbolicated(crash_log, options)
14411446
print()
14421447

0 commit comments

Comments
 (0)