From 44362e06d1a963ac6ed55b01f3c13bc4e1e55a45 Mon Sep 17 00:00:00 2001 From: Greg Clayton Date: Sat, 12 Jul 2014 00:11:34 +0000 Subject: Allow generic ARM cores to match any more specific ARM architecture. llvm-svn: 212863 --- .../Plugins/ObjectFile/ELF/ObjectFileELF.cpp | 25 ++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) (limited to 'lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp') diff --git a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp index e7266d2776d..50cdd18a8fb 100644 --- a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp +++ b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp @@ -1251,8 +1251,29 @@ ObjectFileELF::GetSectionHeaderInfo(SectionHeaderColl §ion_headers, if (arch_spec.GetTriple ().getOS () == llvm::Triple::OSType::UnknownOS) { arch_spec.SetArchitecture (eArchTypeELF, header.e_machine, LLDB_INVALID_CPUTYPE); - arch_spec.GetTriple().setOSName (Host::GetOSString().GetCString()); - arch_spec.GetTriple().setVendorName(Host::GetVendorString().GetCString()); + switch (arch_spec.GetAddressByteSize()) + { + case 4: + { + const ArchSpec host_arch32 = Host::GetArchitecture (Host::eSystemDefaultArchitecture32); + if (host_arch32.GetCore() == arch_spec.GetCore()) + { + arch_spec.GetTriple().setOSName (Host::GetOSString().GetCString()); + arch_spec.GetTriple().setVendorName(Host::GetVendorString().GetCString()); + } + } + break; + case 8: + { + const ArchSpec host_arch64 = Host::GetArchitecture (Host::eSystemDefaultArchitecture64); + if (host_arch64.GetCore() == arch_spec.GetCore()) + { + arch_spec.GetTriple().setOSName (Host::GetOSString().GetCString()); + arch_spec.GetTriple().setVendorName(Host::GetVendorString().GetCString()); + } + } + break; + } } // If there are no section headers we are done. -- cgit v1.2.3