summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/ObjectFile
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2014-07-28 16:44:49 +0000
committerZachary Turner <zturner@google.com>2014-07-28 16:44:49 +0000
commitad587ae4ca143d388c0ec4ef2faa1b5eddedbf67 (patch)
treede86d3fc9716f9768adc2102ba1cac9910068d4a /lldb/source/Plugins/ObjectFile
parent3b2065f0176db3573b30381575c1655dc42c8dfe (diff)
downloadbcm5719-llvm-ad587ae4ca143d388c0ec4ef2faa1b5eddedbf67.tar.gz
bcm5719-llvm-ad587ae4ca143d388c0ec4ef2faa1b5eddedbf67.zip
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
Diffstat (limited to 'lldb/source/Plugins/ObjectFile')
-rw-r--r--lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp6
-rw-r--r--lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h25
2 files changed, 30 insertions, 1 deletions
diff --git a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
index 512656aefcf..43661987127 100644
--- a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
+++ b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
@@ -129,7 +129,11 @@ ObjectFilePECOFF::GetModuleSpecifications (const lldb_private::FileSpec& file,
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 87d8e6a5de2..4be026aa630 100644
--- a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h
+++ b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h
@@ -18,6 +18,31 @@ class ObjectFilePECOFF :
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
OpenPOWER on IntegriCloud