[Lldb-commits] [lldb] 21a597c - [lldb/crashlog] Fix module loading for crashed thread behaviour

Med Ismail Bennani via lldb-commits lldb-commits at lists.llvm.org
Fri Aug 18 12:50:57 PDT 2023


Author: Med Ismail Bennani
Date: 2023-08-18T20:50:39+01:00
New Revision: 21a597c31cb8ad03e18a293c73ecd7c498387ef8

URL: https://github.com/llvm/llvm-project/commit/21a597c31cb8ad03e18a293c73ecd7c498387ef8
DIFF: https://github.com/llvm/llvm-project/commit/21a597c31cb8ad03e18a293c73ecd7c498387ef8.diff

LOG: [lldb/crashlog] Fix module loading for crashed thread behaviour

Before 27f27d15f, 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.

Differential Revision: https://reviews.llvm.org/D157850

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

Added: 
    

Modified: 
    lldb/examples/python/crashlog.py

Removed: 
    


################################################################################
diff  --git a/lldb/examples/python/crashlog.py b/lldb/examples/python/crashlog.py
index f91400a6c36051..216eb7c56690cc 100755
--- a/lldb/examples/python/crashlog.py
+++ b/lldb/examples/python/crashlog.py
@@ -1590,10 +1590,10 @@ def CreateSymbolicateCrashLogOptions(
     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",


        


More information about the lldb-commits mailing list