diff options
author | Med Ismail Bennani <ismail@bennani.ma> | 2024-06-05 20:22:36 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-05 20:22:36 -0700 |
commit | 86dddbe3b54eae22db6e208e6bc1c3cda9b7e149 (patch) | |
tree | 9445f2231b658493e7ad6b5acf8afff7e5919003 /lldb | |
parent | 8c9bb9c506a08b06607c7bf931a384095f0553ee (diff) | |
download | llvm-86dddbe3b54eae22db6e208e6bc1c3cda9b7e149.zip llvm-86dddbe3b54eae22db6e208e6bc1c3cda9b7e149.tar.gz llvm-86dddbe3b54eae22db6e208e6bc1c3cda9b7e149.tar.bz2 |
[lldb/crashlog] Always load Application Specific Backtrace Thread images (#94259)
This patch changes the crashlog image loading default behaviour to not
only load images from the crashed thread but also for the application
specific backtrace thread.
This patch also move the Application Specific Backtrace / Last Exception
Backtrace tag from the thread queue field to the thread name.
rdar://128276576
Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
Diffstat (limited to 'lldb')
4 files changed, 9 insertions, 10 deletions
diff --git a/lldb/examples/python/crashlog.py b/lldb/examples/python/crashlog.py index 7c6c60e..5281d6d 100755 --- a/lldb/examples/python/crashlog.py +++ b/lldb/examples/python/crashlog.py @@ -547,9 +547,9 @@ class CrashLog(symbolication.Symbolicator): for image in self.images: image.resolve = True elif options.crashed_only: + images_to_load = [] for thread in self.threads: - if thread.did_crash(): - images_to_load = [] + if thread.did_crash() or thread.app_specific_backtrace: for ident in thread.idents: for image in self.find_images_with_identifier(ident): image.resolve = True @@ -864,7 +864,7 @@ class JSONCrashLogParser(CrashLogParser): thread = self.crashlog.Thread( len(self.crashlog.threads), True, self.crashlog.process_arch ) - thread.queue = "Application Specific Backtrace" + thread.name = "Application Specific Backtrace" if self.parse_asi_backtrace(thread, json_app_specific_bts[0]): self.crashlog.threads.append(thread) else: @@ -874,7 +874,7 @@ class JSONCrashLogParser(CrashLogParser): thread = self.crashlog.Thread( len(self.crashlog.threads), True, self.crashlog.process_arch ) - thread.queue = "Last Exception Backtrace" + thread.name = "Last Exception Backtrace" self.parse_frames(thread, json_last_exc_bts) self.crashlog.threads.append(thread) @@ -1174,11 +1174,13 @@ class TextCrashLogParser(CrashLogParser): self.thread = self.crashlog.Thread( idx, True, self.crashlog.process_arch ) + self.thread.name = "Application Specific Backtrace" elif line.startswith("Last Exception Backtrace:"): # iOS self.parse_mode = self.CrashLogParseMode.THREAD self.app_specific_backtrace = True idx = 1 self.thread = self.crashlog.Thread(idx, True, self.crashlog.process_arch) + self.thread.name = "Last Exception Backtrace" self.crashlog.info_lines.append(line.strip()) def parse_thread(self, line): diff --git a/lldb/examples/python/crashlog_scripted_process.py b/lldb/examples/python/crashlog_scripted_process.py index 2ee0302..be0ed49 100644 --- a/lldb/examples/python/crashlog_scripted_process.py +++ b/lldb/examples/python/crashlog_scripted_process.py @@ -173,10 +173,7 @@ class CrashLogScriptedThread(ScriptedThread): self.backing_thread = crashlog_thread self.idx = self.backing_thread.index self.tid = self.backing_thread.id - if self.backing_thread.app_specific_backtrace: - self.name = "Application Specific Backtrace" - else: - self.name = self.backing_thread.name + self.name = self.backing_thread.name self.queue = self.backing_thread.queue self.has_crashed = self.originating_process.crashed_thread_idx == self.idx self.create_stackframes() diff --git a/lldb/test/Shell/ScriptInterpreter/Python/Crashlog/app_specific_backtrace_crashlog.test b/lldb/test/Shell/ScriptInterpreter/Python/Crashlog/app_specific_backtrace_crashlog.test index c57cefd..430febb 100644 --- a/lldb/test/Shell/ScriptInterpreter/Python/Crashlog/app_specific_backtrace_crashlog.test +++ b/lldb/test/Shell/ScriptInterpreter/Python/Crashlog/app_specific_backtrace_crashlog.test @@ -3,7 +3,7 @@ # RUN: mkdir -p %t.dir # RUN: yaml2obj %S/Inputs/application_specific_info/asi.yaml > %t.dir/asi # RUN: %lldb -o 'command script import lldb.macosx.crashlog' \ -# RUN: -o 'crashlog -a -i -t %t.dir/asi %S/Inputs/application_specific_info/asi.txt' \ +# RUN: -o 'crashlog -i -t %t.dir/asi %S/Inputs/application_specific_info/asi.txt' \ # RUN: -o "thread list" -o "bt all" 2>&1 | FileCheck %s # CHECK: "crashlog" {{.*}} commands have been installed, use the "--help" options on these commands diff --git a/lldb/test/Shell/ScriptInterpreter/Python/Crashlog/last_exception_backtrace_crashlog.test b/lldb/test/Shell/ScriptInterpreter/Python/Crashlog/last_exception_backtrace_crashlog.test index c2f6196..fa857ac 100644 --- a/lldb/test/Shell/ScriptInterpreter/Python/Crashlog/last_exception_backtrace_crashlog.test +++ b/lldb/test/Shell/ScriptInterpreter/Python/Crashlog/last_exception_backtrace_crashlog.test @@ -3,7 +3,7 @@ # RUN: mkdir -p %t.dir # RUN: yaml2obj %S/Inputs/application_specific_info/asi.yaml > %t.dir/asi # RUN: %lldb -o 'command script import lldb.macosx.crashlog' \ -# RUN: -o 'crashlog -a -i -t %t.dir/asi %S/Inputs/application_specific_info/leb.txt' \ +# RUN: -o 'crashlog -i -t %t.dir/asi %S/Inputs/application_specific_info/leb.txt' \ # RUN: -o "thread list" -o "bt all" 2>&1 | FileCheck %s # CHECK: "crashlog" {{.*}} commands have been installed, use the "--help" options on these commands |