summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/ArchSpec.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Core/ArchSpec.cpp')
-rw-r--r--lldb/source/Core/ArchSpec.cpp19
1 files changed, 18 insertions, 1 deletions
diff --git a/lldb/source/Core/ArchSpec.cpp b/lldb/source/Core/ArchSpec.cpp
index d171fb19c09..34a201e6abc 100644
--- a/lldb/source/Core/ArchSpec.cpp
+++ b/lldb/source/Core/ArchSpec.cpp
@@ -840,7 +840,7 @@ ArchSpec::MergeFrom(const ArchSpec &other)
}
bool
-ArchSpec::SetArchitecture (ArchitectureType arch_type, uint32_t cpu, uint32_t sub)
+ArchSpec::SetArchitecture (ArchitectureType arch_type, uint32_t cpu, uint32_t sub, uint32_t os)
{
m_core = kCore_invalid;
bool update_triple = true;
@@ -885,6 +885,23 @@ ArchSpec::SetArchitecture (ArchitectureType arch_type, uint32_t cpu, uint32_t su
break;
}
}
+ else if (arch_type == eArchTypeELF)
+ {
+ llvm::Triple::OSType ostype;
+ switch (os)
+ {
+ case llvm::ELF::ELFOSABI_AIX: ostype = llvm::Triple::OSType::AIX; break;
+ case llvm::ELF::ELFOSABI_FREEBSD: ostype = llvm::Triple::OSType::FreeBSD; break;
+ case llvm::ELF::ELFOSABI_GNU: ostype = llvm::Triple::OSType::Linux; break;
+ case llvm::ELF::ELFOSABI_NETBSD: ostype = llvm::Triple::OSType::NetBSD; break;
+ case llvm::ELF::ELFOSABI_OPENBSD: ostype = llvm::Triple::OSType::OpenBSD; break;
+ case llvm::ELF::ELFOSABI_SOLARIS: ostype = llvm::Triple::OSType::Solaris; break;
+ default:
+ ostype = llvm::Triple::OSType::UnknownOS;
+ }
+ m_triple.setOS (ostype);
+ m_triple.setVendor (llvm::Triple::UnknownVendor);
+ }
// Fall back onto setting the machine type if the arch by name failed...
if (m_triple.getArch () == llvm::Triple::UnknownArch)
m_triple.setArch (core_def->machine);
OpenPOWER on IntegriCloud