summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/ObjectFile
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Plugins/ObjectFile')
-rw-r--r--lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp36
-rw-r--r--lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp4
2 files changed, 6 insertions, 34 deletions
diff --git a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
index b34dd3db289..6a5b5f32eb6 100644
--- a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
+++ b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
@@ -25,8 +25,6 @@
#define CASE_AND_STREAM(s, def, width) case def: s->Printf("%-*s", width, #def); break;
-static uint32_t ELFMachineToMachCPU(Elf32_Half machine);
-
using namespace lldb;
using namespace lldb_private;
using namespace std;
@@ -824,24 +822,6 @@ ObjectFileELF::DumpELFSectionHeaders(Stream *s)
}
}
-static uint32_t
-ELFMachineToMachCPU(Elf32_Half machine)
-{
- switch (machine)
- {
- case EM_SPARC: return CPU_TYPE_SPARC;
- case EM_386: return CPU_TYPE_I386;
- case EM_68K: return CPU_TYPE_MC680x0;
- case EM_88K: return CPU_TYPE_MC88000;
- case EM_860: return CPU_TYPE_I860;
- case EM_MIPS: return 8; // commented out in mach/machine.h
- case EM_PPC: return CPU_TYPE_POWERPC;
- case EM_PPC64: return CPU_TYPE_POWERPC64;
- case EM_ARM: return 12; // commented out in mach/machine.h
- }
- return 0;
-}
-
bool
ObjectFileELF::GetTargetTriple (ConstString &target_triple)
{
@@ -866,10 +846,10 @@ ObjectFileELF::GetTargetTriple (ConstString &target_triple)
case EM_PPC64: triple.assign("powerpc64-"); break;
case EM_ARM: triple.assign("arm-"); break;
}
- // TODO: determine if there is a vendor in the ELF? Default to "apple" for now
- triple += "apple-";
- // TODO: determine if there is an OS in the ELF? Default to "darwin" for now
- triple += "darwin10";
+ // TODO: determine if there is a vendor in the ELF? Default to "linux" for now
+ triple += "linux-";
+ // TODO: determine if there is an OS in the ELF? Default to "gnu" for now
+ triple += "gnu";
g_target_triple.SetCString(triple.c_str());
target_triple = g_target_triple;
}
@@ -877,14 +857,6 @@ ObjectFileELF::GetTargetTriple (ConstString &target_triple)
}
-//bool
-//ELF32RuntimeFileParser::GetArch(ArchSpec &arch) const
-//{
-// arch.SetCPUType(ELFMachineToMachCPU(m_header.e_machine));
-// arch.SetCPUSubtype(ArchSpec::eAny);
-// return true;
-//}
-
//------------------------------------------------------------------
// PluginInterface protocol
//------------------------------------------------------------------
diff --git a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
index 682a116d213..21860e1e4fb 100644
--- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
+++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
@@ -171,7 +171,7 @@ ObjectFileMachO::ParseHeader ()
{
m_data.GetU32(&offset, &m_header.cputype, 6);
- ArchSpec mach_arch(m_header.cputype, m_header.cpusubtype);
+ ArchSpec mach_arch(eArchTypeMachO, m_header.cputype, m_header.cpusubtype);
if (mach_arch == m_module->GetArchitecture())
{
// Read in all only the load command data
@@ -1168,7 +1168,7 @@ ObjectFileMachO::Dump (Stream *s)
else
s->PutCString("ObjectFileMachO32");
- ArchSpec header_arch(m_header.cputype, m_header.cpusubtype);
+ ArchSpec header_arch(eArchTypeMachO, m_header.cputype, m_header.cpusubtype);
*s << ", file = '" << m_file << "', arch = " << header_arch.AsCString() << "\n";
OpenPOWER on IntegriCloud