History log of /llvm-project/lldb/examples/python/crashlog.py (Results 1 – 25 of 162)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-21-init, llvmorg-19.1.7
# 833a1748 10-Jan-2025 Med Ismail Bennani <ismail@bennani.ma>

[lldb/crashlog] Fix typo in error message when creating a target (#122514)

This fixes a typo when creating a target from the crashlog script and
that we were not able to find a valid architecture fr

[lldb/crashlog] Fix typo in error message when creating a target (#122514)

This fixes a typo when creating a target from the crashlog script and
that we were not able to find a valid architecture from the crash
report.

rdar://137344016

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

show more ...


Revision tags: llvmorg-19.1.6, llvmorg-19.1.5, llvmorg-19.1.4, llvmorg-19.1.3, llvmorg-19.1.2, llvmorg-19.1.1, llvmorg-19.1.0, llvmorg-19.1.0-rc4, llvmorg-19.1.0-rc3, llvmorg-19.1.0-rc2, llvmorg-19.1.0-rc1, llvmorg-20-init
# fd35a923 26-Jun-2024 Eisuke Kawashima <e.kawaschima+github@gmail.com>

[lldb] fix(lldb/**.py): fix comparison to True/False (#94039)

from PEP8
(https://peps.python.org/pep-0008/#programming-recommendations):

> Comparisons to singletons like None should always be do

[lldb] fix(lldb/**.py): fix comparison to True/False (#94039)

from PEP8
(https://peps.python.org/pep-0008/#programming-recommendations):

> Comparisons to singletons like None should always be done with is or
is not, never the equality operators.

Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>

show more ...


# 1373f7c7 21-Jun-2024 Med Ismail Bennani <ismail@bennani.ma>

Revert "[lldb/crashlog] Make interactive mode the new default" (#96263)

Reverts llvm/llvm-project#94575 since introduces test failure:


https://green.lab.llvm.org/job/llvm.org/view/LLDB/job/as-l

Revert "[lldb/crashlog] Make interactive mode the new default" (#96263)

Reverts llvm/llvm-project#94575 since introduces test failure:


https://green.lab.llvm.org/job/llvm.org/view/LLDB/job/as-lldb-cmake/6166/

show more ...


# aafa0ef9 21-Jun-2024 Med Ismail Bennani <ismail@bennani.ma>

[lldb/crashlog] Make interactive mode the new default (#94575)

This patch makes interactive mode as the default when using the crashlog
command. It replaces the existing `-i|--interactive` flag wit

[lldb/crashlog] Make interactive mode the new default (#94575)

This patch makes interactive mode as the default when using the crashlog
command. It replaces the existing `-i|--interactive` flag with a new
`-m|--mode` option, that can either be `interactive` or `batch`.

By default, when the option is not explicitely set by the user, the
interactive mode is selected, however, lldb will fallback to batch mode
if the command interpreter is not interactive or if stdout is not a tty.

This also adds some railguards to prevent users from using interactive
only options with the batch mode and updates the tests accordingly.

rdar://97801509

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

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

show more ...


Revision tags: llvmorg-18.1.8
# d09231a4 06-Jun-2024 Med Ismail Bennani <ismail@bennani.ma>

[lldb/crashlog] Remove aarch64 requirement on crashlog tests (#94553)

This PR removes the `target-aarch64` requirement on the crashlog tests
to exercice them on Intel bots and make image loading si

[lldb/crashlog] Remove aarch64 requirement on crashlog tests (#94553)

This PR removes the `target-aarch64` requirement on the crashlog tests
to exercice them on Intel bots and make image loading single-threaded
temporarily while implementing a fix for a deadlock issue when loading
the images in parallel.

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

show more ...


# 86dddbe3 06-Jun-2024 Med Ismail Bennani <ismail@bennani.ma>

[lldb/crashlog] Always load Application Specific Backtrace Thread images (#94259)

This patch changes the crashlog image loading default behaviour to not
only load images from the crashed thread but

[lldb/crashlog] Always load Application Specific Backtrace Thread images (#94259)

This patch changes the crashlog image loading default behaviour to not
only load images from the crashed thread but also for the application
specific backtrace thread.

This patch also move the Application Specific Backtrace / Last Exception
Backtrace tag from the thread queue field to the thread name.

rdar://128276576

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

show more ...


# 68a9cb79 05-Jun-2024 Med Ismail Bennani <ismail@bennani.ma>

[lldb/crashlog] Add `--no-parallel-image-loading` hidden flag (#94513)

This patch adds the `--no-parallel-image-loading` to the crashlog
command. By default, image loading will happen in parallel i

[lldb/crashlog] Add `--no-parallel-image-loading` hidden flag (#94513)

This patch adds the `--no-parallel-image-loading` to the crashlog
command. By default, image loading will happen in parallel in the
crashlog script however, sometimes, when running tests or debugging the
crashlog script itself, it's better to load the images sequentially.

As its name suggests, this flag will disable the default image loading
behaviour to load all the images sequencially in the main thread.

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

show more ...


Revision tags: llvmorg-18.1.7
# f8afa763 05-Jun-2024 Med Ismail Bennani <ismail@bennani.ma>

[lldb/crashlog] Use environment variable to manually set dsymForUUIDBinary (#94517)

In lldb, users can change the `dsymForUUID` binary using the
`LLDB_APPLE_DSYMFORUUID_EXECUTABLE` environment vari

[lldb/crashlog] Use environment variable to manually set dsymForUUIDBinary (#94517)

In lldb, users can change the `dsymForUUID` binary using the
`LLDB_APPLE_DSYMFORUUID_EXECUTABLE` environment variable.

This patch changes the crashlog to support the same behaviour as lldb
and uses this environment variable to disable `dsymForUUID` lookups in
crashlog test by having it be empty. Since CI bots shoudn't have access
to images on build records, it doesn't make sense to make use of
`dsymForUUID` in tests.

rdar://128953725

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

show more ...


Revision tags: llvmorg-18.1.6
# db942138 09-May-2024 Med Ismail Bennani <ismail@bennani.ma>

[lldb/crashlog] Fix test failure when creating a target using command options (#91653)

This should fix the various crashlog test failures on the bots:

```
lldb-shell :: ScriptInterpreter/Pytho

[lldb/crashlog] Fix test failure when creating a target using command options (#91653)

This should fix the various crashlog test failures on the bots:

```
lldb-shell :: ScriptInterpreter/Python/Crashlog/app_specific_backtrace_crashlog.test
lldb-shell :: ScriptInterpreter/Python/Crashlog/interactive_crashlog_json.test
lldb-shell :: ScriptInterpreter/Python/Crashlog/interactive_crashlog_legacy.test
lldb-shell :: ScriptInterpreter/Python/Crashlog/last_exception_backtrace_crashlog.test
lldb-shell :: ScriptInterpreter/Python/Crashlog/skipped_status_interactive_crashlog.test
```

When we create a target by using the command option, we don't set it in
the crashlog object which later on cause us to fail loading the images.

rdar://127832961

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

show more ...


# f4a7e1f9 09-May-2024 Med Ismail Bennani <ismail@bennani.ma>

[lldb/crashlog] Fix module binary resolution (#91631)

This patch fixes a bug in when resolving and loading modules from the
binary image list.

When loading a module, we would first use the UUID

[lldb/crashlog] Fix module binary resolution (#91631)

This patch fixes a bug in when resolving and loading modules from the
binary image list.

When loading a module, we would first use the UUID from the binary image
list with `dsymForUUID` to fetch the dSYM bundle from our remote build
records and copy the executable locally.

If we failed to find a matching dSYM bundle for that UUID on the build
record, let's say if that module was built locally, we use Spotlight
(`mdfind`) to find the dSYM bundle once again using the UUID.

Prior to this patch, we would set the image path to be the same as the
symbol file. This resulted in trying to load the dSYM as a module in
lldb, which isn't allowed.

This patch address that by looking for a binary matching the image
identifier, next to the dSYM bundle and try to load that instead.

rdar://127433616

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

show more ...


# 8585bf75 09-May-2024 Med Ismail Bennani <ismail@bennani.ma>

[lldb/crashlog] Update incorrect help message for `--no-crashed-only` option (#91162)

This patch rephrases the crashlog `--no-crashed-only` option help
message. This option is mainly used in batch

[lldb/crashlog] Update incorrect help message for `--no-crashed-only` option (#91162)

This patch rephrases the crashlog `--no-crashed-only` option help
message. This option is mainly used in batch mode to symbolicate and
dump all the threads backtraces, instead of only doing it for the
crashed thread which is the default behavior.

rdar://127391524

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

show more ...


# 785b143a 09-May-2024 Med Ismail Bennani <ismail@bennani.ma>

[lldb/crashlog] Enforce image loading policy (#91109)

In `27f27d1`, we changed the image loading logic to conform to the
various options (`-a|--load-all` & `-c|--crashed-only`) and loaded them
con

[lldb/crashlog] Enforce image loading policy (#91109)

In `27f27d1`, we changed the image loading logic to conform to the
various options (`-a|--load-all` & `-c|--crashed-only`) and loaded them
concurrently.

However, instead of the subset of images that matched the user option,
the thread pool would always run on all the crashlog images, causing
them to be all loaded in the target everytime.

This matches the `-a|--load-all` option behaviour but depending on the
report, it can cause lldb to load thousands of images, which can take a
very long time if the images are downloaded over the network.

This patch fixes that issue by keeping a list of `images_to_load` based
of
the user-provided option. This list will be used with our executor
thread pool to load the images according to the user selection, and
reinstates
the expected default behaviour, by only loading the crashed thread
images and
skipping all the others.

This patch also unifies the way we load images into a single method
that's shared by both the batch mode & the interactive scripted process.

rdar://123694062

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

show more ...


Revision tags: llvmorg-18.1.5, llvmorg-18.1.4, llvmorg-18.1.3, llvmorg-18.1.2, llvmorg-18.1.1
# 5000e4c2 04-Mar-2024 Med Ismail Bennani <ismail@bennani.ma>

[lldb/crashlog] Fix breaking changes in textual report format (#83861)

This patch should address some register parsing issue in the legacy
report format.

rdar://107210149

Signed-off-by: Med I

[lldb/crashlog] Fix breaking changes in textual report format (#83861)

This patch should address some register parsing issue in the legacy
report format.

rdar://107210149

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

show more ...


Revision tags: llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init, llvmorg-17.0.6
# ec6a34e2 17-Nov-2023 Jonas Devlieghere <jonas@devlieghere.com>

[lldb] Pass important options to dsymForUUID (#72669)

On macOS, we usually use the DebugSymbols framework to find dSYMs, but
we have a few places (including crashlog.py) that calls out directly to

[lldb] Pass important options to dsymForUUID (#72669)

On macOS, we usually use the DebugSymbols framework to find dSYMs, but
we have a few places (including crashlog.py) that calls out directly to
dsymForUUID. Currently, this invocation is missing two important
options:

* `--ignoreNegativeCache`: Poor network connectivity or lack of VPN can
lead to a negative cache hit. Avoiding those issues is worth the penalty
of skipping these caches.
* `--copyExecutable`: Ensure we copy the executable as it might not be
available at its original location.

rdar://118480731

show more ...


Revision tags: llvmorg-17.0.5, llvmorg-17.0.4, llvmorg-17.0.3, llvmorg-17.0.2, llvmorg-17.0.1, llvmorg-17.0.0, llvmorg-17.0.0-rc4, llvmorg-17.0.0-rc3
# 446abb51 21-Aug-2023 Med Ismail Bennani <ismail@bennani.ma>

[lldb/crashlog] Fix python version requirement issue

In 21a597c, we fixed a module loading issue by using the new
`argparse.BooleanOptionalAction`. However, this is only available
starting python 3.

[lldb/crashlog] Fix python version requirement issue

In 21a597c, we fixed a module loading issue by using the new
`argparse.BooleanOptionalAction`. However, this is only available
starting python 3.9 and causes test failures on bots that don't fulfill
this requirement.

To address that, this patch replaces the use of `BooleanOptionalAction`
by a pair of 2 opposite `store` actions pointing to the same destination
variable.

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

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

show more ...


# a3e6ac16 18-Aug-2023 Med Ismail Bennani <ismail@bennani.ma>

[lldb/test] Fix TestSaveCrashlog.py following changes in eef5eadbe617

This patch fixes TestSaveCrashlog.py failure introduces by eef5eadbe617,
which restricts the number of positional argument for t

[lldb/test] Fix TestSaveCrashlog.py following changes in eef5eadbe617

This patch fixes TestSaveCrashlog.py failure introduces by eef5eadbe617,
which restricts the number of positional argument for the output file to 1.

I expected to get the output file but `argparse` puts the object in a
list (even by constrained to a singled positional argument).

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

show more ...


# 9a44eedb 18-Aug-2023 Med Ismail Bennani <ismail@bennani.ma>

[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-cra

[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>

show more ...


# 4c4f0d81 18-Aug-2023 Med Ismail Bennani <ismail@bennani.ma>

[lldb/crashlog] Add support for Last Exception Backtrace

This patch adds support to the "Last Exception Backtrace" to the
`crashlog` command.

This metadata is homologous to the "Application Specifi

[lldb/crashlog] Add support for Last Exception Backtrace

This patch adds support to the "Last Exception Backtrace" to the
`crashlog` command.

This metadata is homologous to the "Application Specific Backtrace",
however the format is closer to a regular stack frame.

Since the thread that "contains" the "Last Exception Backtrace" doesn't
really exist, this information is displayed when requesting an extended
backtrace of the crashed thread, similarly to the "Application Specific
Backtrace".

To achieve that, this patch includes some refactors and fixes to the
existing "Application Specific Backtrace" handling.

rdar://113046509

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

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

show more ...


# 3054a0c4 14-Aug-2023 Med Ismail Bennani <ismail@bennani.ma>

[lldb/crashlog] Remove dead code (NFC)

This patch cleans up the crashlog.py script and removes dead code.

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


# 21a597c3 14-Aug-2023 Med Ismail Bennani <ismail@bennani.ma>

[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, im

[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@bennani.ma>

show more ...


# eef5eadb 14-Aug-2023 Med Ismail Bennani <ismail@bennani.ma>

[lldb/crashlog] Replace deprecated optparse by argparse (NFC)

This patch replace the deprecated `optparse` module used for the
`crashlog`& `save_crashlog` commands with the new `argparse` from the
p

[lldb/crashlog] Replace deprecated optparse by argparse (NFC)

This patch replace the deprecated `optparse` module used for the
`crashlog`& `save_crashlog` commands with the new `argparse` from the
python standard library. This provides many benefits such as showing the
default values for each option in the help description, but also greatly
improve the handling of position arguments.

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

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

show more ...


# 75bed965 11-Aug-2023 Med Ismail Bennani <ismail@bennani.ma>

[lldb/crashlog] Fix sticky image parsing logic

Prior to this patch, when a user loaded multiple crash report in lldb,
they could get in a situation where all the targets would keep the same
architec

[lldb/crashlog] Fix sticky image parsing logic

Prior to this patch, when a user loaded multiple crash report in lldb,
they could get in a situation where all the targets would keep the same
architecture and executable path as the first one that we've created.

The reason behind this was that even if we created a new CrashLog
object, which is derived from a Symbolicator class that has a newly
constructoted image list as a default argument, because that default
argument is only created once when the function is defined, every CrashLog
object would share the same list.

That will cause use to append newly parsed images to the same
Symbolicator image list accross multiple CrashLog objects.

To address this, this patch changes the default argument value for the
image parameter to `None` and only initialize it as an empty list when
no argument was passed.

This also removes the image list stored in each CrashLog parsers since
they shouldn't have any state and should be re-usable. So now, the only
source of truth is stored in the CrashLog object.

rdar://84984949

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

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

show more ...


Revision tags: llvmorg-17.0.0-rc2
# 4677041d 03-Aug-2023 Med Ismail Bennani <ismail@bennani.ma>

[lldb/crashlog] Move CrashLogParseMode into TextCrashLogParser (NFC)

This patch moves CrashLogParseMode into TextCrashLogParser since it's
the only class using it.

Signed-off-by: Med Ismail Bennani

[lldb/crashlog] Move CrashLogParseMode into TextCrashLogParser (NFC)

This patch moves CrashLogParseMode into TextCrashLogParser since it's
the only class using it.

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

show more ...


# 8f75c4d0 11-Aug-2023 Med Ismail Bennani <ismail@bennani.ma>

[lldb/crashlog] Make TextCrashLogParser more resilient to new lines

This patch changes the parsing logic for the legacy crash report format
to avoid interrupting the parsing if there are new lines i

[lldb/crashlog] Make TextCrashLogParser more resilient to new lines

This patch changes the parsing logic for the legacy crash report format
to avoid interrupting the parsing if there are new lines in the middle
of a section.

To do, the parser starts to skip all consecutive empty lines. If the
number of lines skipped is greater than 1, the parser considers that it
reached a new setion of the report and should reset the parsing mode to
back to normal.

Otherwise, it tries to parse the next line in the current parsing mode.
If it succeeds, the parser will also skip that line since it has already
been parsed and continue the parsing.

rdar://107022595

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

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

show more ...


# f043e66e 11-Aug-2023 Med Ismail Bennani <ismail@bennani.ma>

[lldb/crashlog] Make register output match lldb ordering in legacy mode

This patch changes the way we dump the registers from the legacy
crashlog command to make sure that the ordering matches the o

[lldb/crashlog] Make register output match lldb ordering in legacy mode

This patch changes the way we dump the registers from the legacy
crashlog command to make sure that the ordering matches the one from lldb.

rdar://109172073

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

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

show more ...


1234567