Skip to content

Commit b3ad739

Browse files
committed
[lldb/crashlog] Fix breaking changes in textual report format
This patch should address some register parsing issue in the legacy report format. rdar://107210149 Signed-off-by: Med Ismail Bennani <[email protected]>
1 parent 03f852f commit b3ad739

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

lldb/examples/python/crashlog.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -849,10 +849,10 @@ def parse_errors(self, json_data):
849849

850850
class TextCrashLogParser(CrashLogParser):
851851
parent_process_regex = re.compile(r"^Parent Process:\s*(.*)\[(\d+)\]")
852-
thread_state_regex = re.compile(r"^Thread \d+ crashed with")
852+
thread_state_regex = re.compile(r"^Thread (\d+ crashed with|State)")
853853
thread_instrs_regex = re.compile(r"^Thread \d+ instruction stream")
854-
thread_regex = re.compile(r"^Thread (\d+).*:")
855-
app_backtrace_regex = re.compile(r"^Application Specific Backtrace (\d+).*:")
854+
thread_regex = re.compile(r"^Thread (\d+).*")
855+
app_backtrace_regex = re.compile(r"^Application Specific Backtrace (\d+).*")
856856

857857
class VersionRegex:
858858
version = r"\(.+\)|(?:arm|x86_)[0-9a-z]+"
@@ -1081,7 +1081,10 @@ def parse_normal(self, line):
10811081
if thread_state_match:
10821082
self.app_specific_backtrace = False
10831083
thread_state_match = self.thread_regex.search(line)
1084-
thread_idx = int(thread_state_match.group(1))
1084+
if thread_state_match:
1085+
thread_idx = int(thread_state_match.group(1))
1086+
else:
1087+
thread_idx = self.crashlog.crashed_thread_idx
10851088
self.parse_mode = self.CrashLogParseMode.THREGS
10861089
self.thread = self.crashlog.threads[thread_idx]
10871090
return

0 commit comments

Comments
 (0)