Made lldb_private::ArchSpec more generic so that it can take a mach-o cpu
type and sub-type, or an ELF e_machine value. Also added a generic CPU type
to the arch spec class so we can have a single arch definition that the LLDB
core code can use. Previously a lot of places in the code were using the
mach-o definitions from a macosx header file.
Switches over to using "llvm/Support/MachO.h" for the llvm::MachO::XXX for the
CPU types and sub types for mach-o ArchSpecs. Added "llvm/Support/ELF.h" so
we can use the "llvm::ELF::XXX" defines for the ELF ArchSpecs.
Got rid of all CPU_TYPE_ and CPU_SUBTYPE_ defines that were previously being
used in LLDB.
llvm-svn: 105806
diff --git a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
index 682a116..21860e1 100644
--- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
+++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
@@ -171,7 +171,7 @@
{
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 @@
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";