https://github.com/medismailben created https://github.com/llvm/llvm-project/pull/83861
This patch should address some register parsing issue in the legacy report format. rdar://107210149 >From b3ad739752a6e07eeeda47055d17a12fc960adcb Mon Sep 17 00:00:00 2001 From: Med Ismail Bennani <ism...@bennani.ma> Date: Sun, 3 Mar 2024 01:07:14 -0800 Subject: [PATCH] [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 <ism...@bennani.ma> --- lldb/examples/python/crashlog.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits