[Lldb-commits] [lldb] [lldb/crashlog] Fix breaking changes in textual report format (PR #83861)
via lldb-commits
lldb-commits at lists.llvm.org
Mon Mar 4 08:27:46 PST 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-lldb
Author: Med Ismail Bennani (medismailben)
<details>
<summary>Changes</summary>
This patch should address some register parsing issue in the legacy report format.
rdar://107210149
---
Full diff: https://github.com/llvm/llvm-project/pull/83861.diff
1 Files Affected:
- (modified) lldb/examples/python/crashlog.py (+7-4)
``````````diff
diff --git a/lldb/examples/python/crashlog.py b/lldb/examples/python/crashlog.py
index 9e4f94264037ae..c992348b24be17 100755
--- a/lldb/examples/python/crashlog.py
+++ b/lldb/examples/python/crashlog.py
@@ -849,10 +849,10 @@ def parse_errors(self, json_data):
class TextCrashLogParser(CrashLogParser):
parent_process_regex = re.compile(r"^Parent Process:\s*(.*)\[(\d+)\]")
- thread_state_regex = re.compile(r"^Thread \d+ crashed with")
+ thread_state_regex = re.compile(r"^Thread (\d+ crashed with|State)")
thread_instrs_regex = re.compile(r"^Thread \d+ instruction stream")
- thread_regex = re.compile(r"^Thread (\d+).*:")
- app_backtrace_regex = re.compile(r"^Application Specific Backtrace (\d+).*:")
+ thread_regex = re.compile(r"^Thread (\d+).*")
+ app_backtrace_regex = re.compile(r"^Application Specific Backtrace (\d+).*")
class VersionRegex:
version = r"\(.+\)|(?:arm|x86_)[0-9a-z]+"
@@ -1081,7 +1081,10 @@ def parse_normal(self, line):
if thread_state_match:
self.app_specific_backtrace = False
thread_state_match = self.thread_regex.search(line)
- thread_idx = int(thread_state_match.group(1))
+ if thread_state_match:
+ thread_idx = int(thread_state_match.group(1))
+ else:
+ thread_idx = self.crashlog.crashed_thread_idx
self.parse_mode = self.CrashLogParseMode.THREGS
self.thread = self.crashlog.threads[thread_idx]
return
``````````
</details>
https://github.com/llvm/llvm-project/pull/83861
More information about the lldb-commits
mailing list