diff options
author | Jason Molenda <jason@molenda.com> | 2022-11-03 20:46:48 +0300 |
---|---|---|
committer | Jason Molenda <jason@molenda.com> | 2022-11-03 20:46:48 +0300 |
commit | fd2065b70f2a74503725ebadb39c5dd2f9aa15c9 (patch) | |
tree | 0a5bb7a9a70933bf9629b54ebe1703e0818b2a51 | |
parent | 7e133eb49b35b1648de786f21f38db084f597b7f (diff) |
Have GetSupportedArchitectures report all supported arches
PlatformDarwinKernel::GetSupportedArchitectures returns a list
of architectures that are possible for this platform; it was using
a compile-time check for the debug host to decide the list of arches
that were valid. This was copied from a codepath doing native process
debugging, and was clearly wrong for kernel debugging, but it had
not happened to cause problems so it went unnoticed for a long time.
Small NFC change to the logging messages of Target::SetArchitecture
to make them a little more explicit about how the architecture is
being modified/replaced.
Differential Revision: https://reviews.llvm.org/D137301
rdar://101690111
-rw-r--r-- | lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp | 3 | ||||
-rw-r--r-- | lldb/source/Target/Target.cpp | 17 |
2 files changed, 12 insertions, 8 deletions
diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp index 8ae211f102cb..3c9cc8e77189 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp @@ -986,11 +986,8 @@ bool PlatformDarwinKernel::LoadPlatformBinaryAndSetup(Process *process, std::vector<ArchSpec> PlatformDarwinKernel::GetSupportedArchitectures( const ArchSpec &process_host_arch) { std::vector<ArchSpec> result; -#if defined(__arm__) || defined(__arm64__) || defined(__aarch64__) ARMGetSupportedArchitectures(result); -#else x86GetSupportedArchitectures(result); -#endif return result; } diff --git a/lldb/source/Target/Target.cpp b/lldb/source/Target/Target.cpp index f1a311b7252c..33a792b683ca 100644 --- a/lldb/source/Target/Target.cpp +++ b/lldb/source/Target/Target.cpp @@ -1436,7 +1436,8 @@ void Target::SetExecutableModule(ModuleSP &executable_sp, if (!m_arch.GetSpec().IsValid()) { m_arch = executable_sp->GetArchitecture(); LLDB_LOG(log, - "setting architecture to {0} ({1}) based on executable file", + "Target::SetExecutableModule setting architecture to {0} ({1}) " + "based on executable file", m_arch.GetSpec().GetArchitectureName(), m_arch.GetSpec().GetTriple().getTriple()); } @@ -1536,7 +1537,9 @@ bool Target::SetArchitecture(const ArchSpec &arch_spec, bool set_platform, // specified if (replace_local_arch) m_arch = other; - LLDB_LOG(log, "set architecture to {0} ({1})", + LLDB_LOG(log, + "Target::SetArchitecture merging compatible arch; arch " + "is now {0} ({1})", m_arch.GetSpec().GetArchitectureName(), m_arch.GetSpec().GetTriple().getTriple()); return true; @@ -1544,9 +1547,13 @@ bool Target::SetArchitecture(const ArchSpec &arch_spec, bool set_platform, // If we have an executable file, try to reset the executable to the desired // architecture - LLDB_LOGF(log, "Target::SetArchitecture changing architecture to %s (%s)", - arch_spec.GetArchitectureName(), - arch_spec.GetTriple().getTriple().c_str()); + LLDB_LOGF( + log, + "Target::SetArchitecture changing architecture to %s (%s) from %s (%s)", + arch_spec.GetArchitectureName(), + arch_spec.GetTriple().getTriple().c_str(), + m_arch.GetSpec().GetArchitectureName(), + m_arch.GetSpec().GetTriple().getTriple().c_str()); m_arch = other; ModuleSP executable_sp = GetExecutableModule(); |