Fix supported architectures on PlatformWindows.
i386, i486, i486sx, and i686 are all indistinguishable as far as
PE/COFF files are concerned. This patch adds support for all of
these architectures to PlatformWindows.
Differential Revision: http://reviews.llvm.org/D4658
llvm-svn: 214092
diff --git a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
index 512656a..4366198 100644
--- a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
+++ b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
@@ -129,7 +129,11 @@
if (ParseCOFFHeader(data, &offset, coff_header))
{
ArchSpec spec;
- spec.SetArchitecture(eArchTypeCOFF, coff_header.machine, LLDB_INVALID_CPUTYPE);
+ llvm::Triple::ArchType archType = llvm::Triple::UnknownArch;
+ if (coff_header.machine == MachineAmd64)
+ spec.SetTriple("x86_64-pc-windows");
+ else if (coff_header.machine == MachineX86)
+ spec.SetTriple("i386-pc-windows");
specs.Append(ModuleSpec(file, spec));
}
}
diff --git a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h
index 87d8e6a..4be026a 100644
--- a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h
+++ b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h
@@ -18,6 +18,31 @@
public lldb_private::ObjectFile
{
public:
+ typedef enum MachineType
+ {
+ MachineUnknown = 0x0,
+ MachineAm33 = 0x1d3,
+ MachineAmd64 = 0x8664,
+ MachineArm = 0x1c0,
+ MachineArmNt = 0x1c4,
+ MachineArm64 = 0xaa64,
+ MachineEbc = 0xebc,
+ MachineX86 = 0x14c,
+ MachineIA64 = 0x200,
+ MachineM32R = 0x9041,
+ MachineMips16 = 0x266,
+ MachineMipsFpu = 0x366,
+ MachineMipsFpu16 = 0x466,
+ MachinePowerPc = 0x1f0,
+ MachinePowerPcfp = 0x1f1,
+ MachineR4000 = 0x166,
+ MachineSh3 = 0x1a2,
+ MachineSh3dsp = 0x1a3,
+ MachineSh4 = 0x1a6,
+ MachineSh5 = 0x1a8,
+ MachineThumb = 0x1c2,
+ MachineWcemIpsv2 = 0x169
+ };
//------------------------------------------------------------------
// Static Functions