summaryrefslogtreecommitdiff
path: root/lldb/test/Shell/ScriptInterpreter/Python/Crashlog/Inputs
AgeCommit message (Collapse)Author
2025-06-20[lldb] Add support for x86_64h to scripted process (#145099)Med Ismail Bennani
This patch adds support to the haswell sub-architecture (x86_64h) to scripted processes. rdar://147208252 Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
2024-03-04[lldb/crashlog] Fix breaking changes in textual report format (#83861)Med Ismail Bennani
This patch should address some register parsing issue in the legacy report format. rdar://107210149 Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
2023-08-18[lldb/crashlog] Add support for Last Exception BacktraceMed Ismail Bennani
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>
2023-08-18[lldb/crashlog] Add test for 8f75c4d01eff3c65d7ae40bfd05582de7dffa590 (NFC)Med Ismail Bennani
Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
2023-06-01[lldb/crashlog] Add test for non-symbolicated report crashMed Ismail Bennani
Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
2023-05-19[lldb/crashlog] Load inlined symbol into interactive crashlogMed Ismail Bennani
Sometimes, crash reports come with inlined symbols. These provide the exact stacktrace from the user binary. However, when investigating a crash, it's very likely that the images related to the crashed thread are not available on the debugging user system or that the versions don't match. This causes interactive crashlog to show a degraded backtrace in lldb. This patch aims to address that issue, by parsing the inlined symbols from the crash report and load them into lldb's target. This patch is a follow-up to 27f27d1, focusing on inlined symbols loading from legacy (non-json) crash reports. To do so, it updates the stack frame regular expression to make the capture groups more granular, to be able to extract the symbol name, the offset and the source location if available, while making it more maintainable. So now, when parsing the crash report, we build a data structure containing all the symbol information for each stackframe. Then, after launching the scripted process for interactive mode, we write a JSON symbol file for each module, only containing the symbols that it contains. Finally, we load the json symbol file into lldb, before showing the user the process status and backtrace. rdar://97345586 Differential Revision: https://reviews.llvm.org/D146765 Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
2023-04-13[lldb] Use ObjectFileJSON to create modules for interactive crashlogsJonas Devlieghere
Create an artificial module using a JSON object file when we can't locate the module and dSYM through dsymForUUID (or however locate_module_and_debug_symbols is implemented). By parsing the symbols from the crashlog and making them part of the JSON object file, LLDB can symbolicate frames it otherwise wouldn't be able to, as there is no module for it. For non-interactive crashlogs, that never was a problem because we could simply show the "pre-symbolicated" frame from the input. For interactive crashlogs, we need a way to pass the symbol information to LLDB so that it can symbolicate the frames, which is what motivated the JSON object file format. Differential revision: https://reviews.llvm.org/D148172
2022-11-15[lldb/test] Fix app_specific_backtrace_crashlog.test (NFC)Med Ismail Bennani
This patch changes app_specific_backtrace_crashlog.test's crashlog file extension from `ips` to `txt. This should prevent the test from opening Console.app when being run. This should also fix a test failure caused by missing symbols. Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2022-11-04[lldb/crashlog] Fix frame parser regex for when there is no source infoMed Ismail Bennani
It can happen that the originator of a crash report doesn't have access to certain images. When that's the case, ReportCrash won't show the source info in the crash report stack frames, but only the stack address and image name. This patch fixes a bug in the crashlog stackframe parser regular expression to optionally match the source info group. rdar://101934135 Differential Revision: https://reviews.llvm.org/D137466 Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2022-11-03[lldb/crashlog] Add support for Application Specific Backtraces & InformationMed Ismail Bennani
For an exception crashlog, the thread backtraces aren't usually very helpful and instead, developpers look at the "Application Specific Backtrace" that was generated by `objc_exception_throw`. LLDB could already parse and symbolicate these Application Specific Backtraces for regular textual-based crashlog, so this patch adds support to parse them in JSON crashlogs, and materialize them a HistoryThread extending the crashed ScriptedThread. This patch also includes the Application Specific Information messages as part of the process extended crash information log. To do so, the ScriptedProcess Python interface has a new GetMetadata method that returns an arbitrary dictionary with data related to the process. rdar://93207586 Differential Revision: https://reviews.llvm.org/D126260 Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2022-11-03[lldb/crashlog] Fix the image_regex_uuid to skip null UUID imagesMed Ismail Bennani
This patch updates the image_regex_uuid matcher to match null-UUID images in the plain text crashlog parser. It updates the regex to match one or more '?' characters or the image full path. rdar://100904019 Differential Revision: https://reviews.llvm.org/D135482 Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2022-08-09[lldb/crashlog] Skip null image dsym fetching on interactive modeMed Ismail Bennani
Sometimes, it can happen that a crash report has null images in its list of used binaries. This manifests like such: ``` 0x0 - 0xffffffffffffffff ??? (*) <00000000-0000-0000-0000-000000000000> ??? ``` When fetching debug symbols to symbolicate the crashlog stackframe, having null images causes `dsymForUUID` to hang for few seconds. This patch addresses that by skipping null images from being load by the scripted process. rdar://97419487 Differential Revision: https://reviews.llvm.org/D131038 Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2022-08-09[lldb/crashlog] Update frame regex matcherMed Ismail Bennani
This patch updates the regular expression matching stackframes in crashlog to allow addresses that are 7 characters long and more (vs. 8 characters previously). It changes the `0x[0-9a-fA-F]{7}[0-9a-fA-F]+` by `0x[0-9a-fA-F]{7,}`. rdar://97684839 Differential Revision: https://reviews.llvm.org/D131032 Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2022-08-09[lldb/crashlog] Fix interactive crashlog testMed Ismail Bennani
This patch should fix the interactive crashlog test by checking in the binary as a yaml to regeneate the binary with the addresses and offsets when running the test. rdar://93655633 Differential Revision: https://reviews.llvm.org/D129603 Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2022-03-16[lldb/crashlog] Create artificial frames for non-crashed scripted threadsMed Ismail Bennani
This patch pipes down the `-a|--load-all` crashlog command option to the Scripted Process initializer to load all the images used by crashed process instead of only loading the images related to the crashed thread. This allows us to recreate artificial frames also for the non-crashed scripted threads. rdar://90396265 Differential Revision: https://reviews.llvm.org/D121826 Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2022-02-25[lldb/crashlog] Fix scripted_crashlog_json.test failureMed Ismail Bennani
This patch should fix the test failure on scripted_crashlog_json.test. The failure is happening because crash reporter will obfuscate the executable path in the crashlog, if it is located inside the user's home directory and replace it with `/USER/*/` as a placeholder. To fix that, we can patch the placeholder with the executable path before loading the crashlog in lldb. This also fixes a bug where we would create another target when loading the crashlog in a scripted process, even if lldb already had a target for it. Now, crashlog will only create a target if there is none in lldb. Differential Revision: https://reviews.llvm.org/D120598 Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2022-02-16[lldb/crashlog] Add CrashLogScriptedProcess & remove interactive modeMed Ismail Bennani
This patch introduces a new type of ScriptedProcess: CrashLogScriptedProcess. It takes advantage of lldb's crashlog parsers and Scripted Processes to reconstruct a static debugging session with symbolicated stackframes, instead of just dumping out everything in the user's terminal. The crashlog command also has an interactive mode that only provide a very limited experience. This is why this patch removes all the logic for this interactive mode and creates CrashLogScriptedProcess instead. This will fetch and load all the libraries that were used by the crashed thread and re-create all the frames artificially. rdar://88721117 Differential Revision: https://reviews.llvm.org/D119501 Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2022-01-31[lldb] Support Rosetta registers in crashlog.pyJonas Devlieghere
Rosetta crashlogs can have their own thread register state. Unlike the other registers which ware directly listed under "threadState", the Rosetta registers are nested under their own key in the JSON, as illustrated below: { "threadState": { "rosetta": { "tmp2": { "value": 4935057216 }, "tmp1": { "value": 4365863188 }, "tmp0": { "value": 18446744073709551615 } } } }
2021-10-07[lldb] Parse and display reporting errors from JSON crashlogsJonas Devlieghere
JSON crashlogs have an optional field named reportNotes that contains any potential errors encountered by the crash reporter when generating the crashlog. Parse and display them in LLDB. Differential revision: https://reviews.llvm.org/D111339
2021-10-07[lldb] Support missing threadState in JSON crashlogsJonas Devlieghere
Gracefully deal with JSON crashlogs that don't have thread state available and print an error saying as much: "No thread state (register information) available". rdar://83955858 Differential revision: https://reviews.llvm.org/D111341
2021-04-22[lldb] Include thread name in crashlog.py outputJonas Devlieghere
Update the JSON parser to include the thread name in the Thread object. rdar://76677320
2021-03-09[lldb] Update crashlog script for JSON changesJonas Devlieghere
Update the crashlog script for changes to the JSON schema. rdar://75122914 Differential revision: https://reviews.llvm.org/D98219
2020-11-16[crashlog] Improve patch-crashlog.py scriptJonas Devlieghere
Compute the real addresses and offsets for the json crashlog test.
2020-11-16[crashlog] Implement parser for JSON encoded crashlogsJonas Devlieghere
Add a parser for JSON crashlogs. The CrashLogParser now defers to either the JSONCrashLogParser or the TextCrashLogParser. It first tries to interpret the input as JSON, and if that fails falling back to the textual parser. Differential revision: https://reviews.llvm.org/D91130