Skip to content

[lldb/crashlog] Always load Application Specific Backtrace Thread images (#94259) #8883

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions lldb/examples/python/crashlog.py
Original file line number Diff line number Diff line change
Expand Up @@ -543,9 +543,9 @@ def load_images(self, options, loaded_images=None):
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
Expand Down Expand Up @@ -860,7 +860,7 @@ def parse_app_specific_backtraces(self, json_app_specific_bts):
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:
Expand All @@ -870,7 +870,7 @@ def parse_last_exception_backtraces(self, json_last_exc_bts):
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)

Expand Down Expand Up @@ -1170,11 +1170,13 @@ def parse_normal(self, line):
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):
Expand Down
5 changes: 1 addition & 4 deletions lldb/examples/python/crashlog_scripted_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,7 @@ def __init__(self, process, args, crashlog_thread):
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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down