aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp
diff options
context:
space:
mode:
authorJason Molenda <jmolenda@apple.com>2025-04-21 10:58:58 -0700
committerGitHub <noreply@github.com>2025-04-21 10:58:58 -0700
commit1ab9e53e4910557f2a4c0f00c7a7f8b5ac493b48 (patch)
treecbe8bdd23f707bb5aa7462e41af1aa942a212b03 /llvm/lib/Analysis/ModuleSummaryAnalysis.cpp
parent3e5a9d9aa04e2c99601ffb6f65032a299a56069c (diff)
downloadllvm-1ab9e53e4910557f2a4c0f00c7a7f8b5ac493b48.zip
llvm-1ab9e53e4910557f2a4c0f00c7a7f8b5ac493b48.tar.gz
llvm-1ab9e53e4910557f2a4c0f00c7a7f8b5ac493b48.tar.bz2
[lldb][Mach-O corefiles] Don't init Target arch to corefile (#136065)
This patch is making three changes, when loading a Mach-O corefile: 1. At the start of `DoLoadCore`, if a binary was provided in addition to the corefile, initialize the Target's ArchSpec. 2. Before ProcessMachCore does its "exhaustive search" fallback, looking through the corefile contents for a userland dyld or mach kernel, we must make sure the Target has an ArchSpec, or methods that check the address word size, or initialize a DataExtractor based on the Target arch will not succeed. 3. Add logging when setting the Target's arch listing exactly what that setting was based on -- the corefile itself, or the main binary. Jonas landed a change last August (started with a patch from me) which removed the Target ArchSpec initialization at the start of DoLoadCore, in a scenario where the corefile had arch armv7 and the main binary had arch armv7em (Cortex-M), and there was python code in the main binary's dSYM which sets the operating system threads provider based on the Target arch. It did different things for armv7 or armv7em, and so it would fail. Jonas' patch removed any ArchSpec setting at the start of DoLoadCore, so we wouldn't have an incorrect arch value, but that broke the exhaustive search for kernel binaries, because we didn't have an address word size or endianness. This patch should navigate the needs of both use cases. I spent a good bit of time trying to construct a test to capture all of these requirements -- but it turns out to be a good bit difficult, encompassing both a genuine kernel corefiles and a microcontroller firmware corefiles. rdar://146821929
Diffstat (limited to 'llvm/lib/Analysis/ModuleSummaryAnalysis.cpp')
0 files changed, 0 insertions, 0 deletions