[Lldb-commits] [PATCH] D157852: [lldb/crashlog] Skip non-crashed threads in batch mode

Med Ismail Bennani via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Aug 14 03:07:46 PDT 2023


mib created this revision.
mib added reviewers: bulbazord, JDevlieghere.
mib added a project: LLDB.
Herald added a project: All.
mib requested review of this revision.
Herald added a subscriber: lldb-commits.

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

Signed-off-by: Med Ismail Bennani <ismail at bennani.ma>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D157852

Files:
  lldb/examples/python/crashlog.py


Index: lldb/examples/python/crashlog.py
===================================================================
--- lldb/examples/python/crashlog.py
+++ lldb/examples/python/crashlog.py
@@ -1436,6 +1436,10 @@
             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()
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D157852.549855.patch
Type: text/x-patch
Size: 477 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20230814/0605c7b6/attachment.bin>


More information about the lldb-commits mailing list