Skip to content

Commit e31b2d7

Browse files
committed
[lldb][crashlog] Avoid specifying arch for image when a UUID is present
When adding an image to a target for crashlog purposes, avoid specifying the architecture of the image. This has the effect of making SBTarget::AddModule infer the ArchSpec for the image based on the SBTarget's architecture, which LLDB puts serious effort into calculating correctly (in TargetList::CreateTargetInternal). The status quo is that LLDB randomly guesses the ArchSpec for a module if its architecture is specified, via: ``` SBTarget::AddModule -> Platform::GetAugmentedArchSpec -> Platform::IsCompatibleArchitecture -> GetSupportedArchitectureAtIndex -> {ARM,x86}GetSupportedArchitectureAtIndex ``` ... which means that the same crashlog can fail to load on an Apple Silicon Mac (due to the random guess of arm64e-apple-macosx for the module's ArchSpec not being compatible with the SBTarget's (correct) ArchSpec), while loading just fine on an Intel Mac. I'm not sure how to add a test for this (it doesn't look like there's test coverage of this path in-tree). It seems like it would be pretty complicated to regression test: the host LLDB would need to be built for arm64e, we'd need a hand-crafted arm64e iOS crashlog, and we'd need a binary with an iOS deployment target. I'm open to other / simpler options. rdar://82679400 Differential Revision: https://reviews.llvm.org/D110013
1 parent 3679d20 commit e31b2d7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lldb/examples/python/symbolication.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ def add_module(self, target):
379379
return None
380380
resolved_path = self.get_resolved_path()
381381
self.module = target.AddModule(
382-
resolved_path, str(self.arch), uuid_str, self.symfile)
382+
resolved_path, None, uuid_str, self.symfile)
383383
if not self.module:
384384
return 'error: unable to get module for (%s) "%s"' % (
385385
self.arch, self.get_resolved_path())

0 commit comments

Comments
 (0)