aboutsummaryrefslogtreecommitdiff
path: root/lldb/examples/python/crashlog.py
diff options
context:
space:
mode:
authorMed Ismail Bennani <ismail@bennani.ma>2023-08-18 20:14:58 +0100
committerMed Ismail Bennani <ismail@bennani.ma>2023-08-18 20:50:39 +0100
commit9a44eedb842d03b0e4d24f8dcc57a49e1a9cc1ac (patch)
tree4138feef1526f650514094806c68a9eed715e07d /lldb/examples/python/crashlog.py
parent4c4f0d81f47cf9ad785dc2ea323ec2f0aedb72df (diff)
downloadllvm-9a44eedb842d03b0e4d24f8dcc57a49e1a9cc1ac.zip
llvm-9a44eedb842d03b0e4d24f8dcc57a49e1a9cc1ac.tar.gz
llvm-9a44eedb842d03b0e4d24f8dcc57a49e1a9cc1ac.tar.bz2
[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 <ismail@bennani.ma>
Diffstat (limited to 'lldb/examples/python/crashlog.py')
-rwxr-xr-xlldb/examples/python/crashlog.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/lldb/examples/python/crashlog.py b/lldb/examples/python/crashlog.py
index 080062b..5f6b84f 100755
--- a/lldb/examples/python/crashlog.py
+++ b/lldb/examples/python/crashlog.py
@@ -949,6 +949,7 @@ class TextCrashLogParser(CrashLogParser):
self.thread.reason += (
" (%s)" % self.crashlog.thread_exception_data
)
+ self.thread.crashed = True
if self.app_specific_backtrace:
self.crashlog.backtraces.append(self.thread)
else:
@@ -1437,6 +1438,10 @@ def SymbolicateCrashLog(crash_log, options):
print()
for thread in crash_log.threads:
+ if options.crashed_only and not (
+ thread.crashed or thread.app_specific_backtrace
+ ):
+ continue
thread.dump_symbolicated(crash_log, options)
print()