Index: source/Core/ArchSpec.cpp =================================================================== --- source/Core/ArchSpec.cpp +++ source/Core/ArchSpec.cpp @@ -989,29 +989,34 @@ } void ArchSpec::MergeFrom(const ArchSpec &other) { - if (TripleVendorIsUnspecifiedUnknown() && - !other.TripleVendorIsUnspecifiedUnknown()) - GetTriple().setVendor(other.GetTriple().getVendor()); - if (TripleOSIsUnspecifiedUnknown() && !other.TripleOSIsUnspecifiedUnknown()) - GetTriple().setOS(other.GetTriple().getOS()); - if (GetTriple().getArch() == llvm::Triple::UnknownArch) - GetTriple().setArch(other.GetTriple().getArch()); - if (GetTriple().getEnvironment() == llvm::Triple::UnknownEnvironment && - !TripleVendorWasSpecified()) { - if (other.TripleVendorWasSpecified()) - GetTriple().setEnvironment(other.GetTriple().getEnvironment()); - } // If this and other are both arm ArchSpecs and this ArchSpec is a generic - // "some kind of arm" - // spec but the other ArchSpec is a specific arm core, adopt the specific arm - // core. + // "some kind of arm" spec but the other ArchSpec is a specific arm core, adopt + // the specific arm core. + bool ShouldOverrideCore = false; + + if (GetCore() == ArchSpec::kCore_invalid && other.GetCore() != ArchSpec::kCore_invalid) + ShouldOverrideCore = true; if (GetTriple().getArch() == llvm::Triple::arm && - other.GetTriple().getArch() == llvm::Triple::arm && - IsCompatibleMatch(other) && GetCore() == ArchSpec::eCore_arm_generic && - other.GetCore() != ArchSpec::eCore_arm_generic) { + other.GetTriple().getArch() == llvm::Triple::arm && + IsCompatibleMatch(other) && GetCore() == ArchSpec::eCore_arm_generic && + other.GetCore() != ArchSpec::eCore_arm_generic) + ShouldOverrideCore = true; + if (ShouldOverrideCore) { m_core = other.GetCore(); CoreUpdated(true); } + + if (GetTriple().getVendor() == llvm::Triple::UnknownVendor) + GetTriple().setVendor(other.GetTriple().getVendor()); + + if (GetTriple().getOS() == llvm::Triple::UnknownOS) + GetTriple().setOS(other.GetTriple().getOS()); + + if (GetTriple().getArch() == llvm::Triple::UnknownArch) + GetTriple().setArch(other.GetTriple().getArch()); + + if (GetTriple().getEnvironment() == llvm::Triple::UnknownEnvironment) + GetTriple().setEnvironment(other.GetTriple().getEnvironment()); } bool ArchSpec::SetArchitecture(ArchitectureType arch_type, uint32_t cpu, Index: source/Plugins/Process/elf-core/ProcessElfCore.cpp =================================================================== --- source/Plugins/Process/elf-core/ProcessElfCore.cpp +++ source/Plugins/Process/elf-core/ProcessElfCore.cpp @@ -220,7 +220,7 @@ target_arch.MergeFrom(core_arch); GetTarget().SetArchitecture(target_arch); - SetUnixSignals(UnixSignals::Create(GetArchitecture())); + SetUnixSignals(UnixSignals::Create(target_arch)); // Ensure we found at least one thread that was stopped on a signal. bool siginfo_signal_found = false; @@ -724,17 +724,7 @@ } ArchSpec ProcessElfCore::GetArchitecture() { - ObjectFileELF *core_file = - (ObjectFileELF *)(m_core_module_sp->GetObjectFile()); - ArchSpec arch; - core_file->GetArchitecture(arch); - - ArchSpec target_arch = GetTarget().GetArchitecture(); - - if (target_arch.IsMIPS()) - return target_arch; - - return arch; + return GetTarget().GetArchitecture(); } const lldb::DataBufferSP ProcessElfCore::GetAuxvData() {