[Lldb-commits] [PATCH] D157850: [lldb/crashlog] Fix module loading for crashed thread behaviour

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


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

Before 27f27d15f <https://reviews.llvm.org/rG27f27d15f6c90b026eca23b8ee238fdbf772fd80>, the `crashlog` command would always load images even
if `-a` or `-c` was not set by the user.

Since that change, images are loaded only when one of these 2 flags are
set, otherwise, we fallback to parsing the symbols from the report and
load them into a `SymbolFileJSON`.

Although that makes it way faster than pulling binaries and debug
symbols from build records, that cause a degraded experience since none
of our users are used to set these 2 flags. For instance, that would
symbolicate the backtraces, however the users wouldn't see sources.

To address that change of behavior, this patch changes the default value
for the `-c|--crash-only` flag to `true`. On the other hand, thanks to
the move to `argparse`, we introduced a new `--no-only-crashed` flag
that will let the user force skipping loading any images, relying only
on the `SymbolFileJSON`.

This gives the users a good compromise since they would be able to see
sources for the crashed thread if they're available, otherwise, they'll
only get a symbolicated backtrace.

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


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D157850

Files:
  lldb/examples/python/crashlog.py


Index: lldb/examples/python/crashlog.py
===================================================================
--- lldb/examples/python/crashlog.py
+++ lldb/examples/python/crashlog.py
@@ -1590,10 +1590,10 @@
     arg_parser.add_argument(
         "--crashed-only",
         "-c",
-        action="store_true",
+        action=argparse.BooleanOptionalAction,
         dest="crashed_only",
         help="only symbolicate the crashed thread",
-        default=False,
+        default=True,
     )
     arg_parser.add_argument(
         "--disasm-depth",


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D157850.549852.patch
Type: text/x-patch
Size: 550 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20230814/e57d1c63/attachment.bin>


More information about the lldb-commits mailing list