aboutsummaryrefslogtreecommitdiff
path: root/lldb/examples/python/crashlog.py
diff options
context:
space:
mode:
authorMed Ismail Bennani <ismail@bennani.ma>2024-03-04 15:44:44 -0800
committerGitHub <noreply@github.com>2024-03-04 15:44:44 -0800
commit5000e4c2527ae53bf7c1a609f739a97cdc522bbe (patch)
treebed6df45b47a446757991fbdeb85b6e8dc9f8c68 /lldb/examples/python/crashlog.py
parent07b1aebced8015c62d4ce0afe07358049afae5b1 (diff)
downloadllvm-5000e4c2527ae53bf7c1a609f739a97cdc522bbe.zip
llvm-5000e4c2527ae53bf7c1a609f739a97cdc522bbe.tar.gz
llvm-5000e4c2527ae53bf7c1a609f739a97cdc522bbe.tar.bz2
[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>
Diffstat (limited to 'lldb/examples/python/crashlog.py')
-rwxr-xr-xlldb/examples/python/crashlog.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/lldb/examples/python/crashlog.py b/lldb/examples/python/crashlog.py
index 9e4f942..c992348 100755
--- a/lldb/examples/python/crashlog.py
+++ b/lldb/examples/python/crashlog.py
@@ -849,10 +849,10 @@ class JSONCrashLogParser(CrashLogParser):
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 @@ class TextCrashLogParser(CrashLogParser):
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