summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2012-03-20 18:34:04 +0000
committerGreg Clayton <gclayton@apple.com>2012-03-20 18:34:04 +0000
commitb3a40ba812cde1ab2571754a97d19215645271ff (patch)
tree2009e24d3e69bb5dc099eee6845a9220a24d3593 /lldb/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp
parent5a6011267adb5770cde18c7807b64baccd7587ad (diff)
downloadbcm5719-llvm-b3a40ba812cde1ab2571754a97d19215645271ff.tar.gz
bcm5719-llvm-b3a40ba812cde1ab2571754a97d19215645271ff.zip
Platforms can now auto-select themselves if you specify a full target triple when doing a "target create" command.
Each platform now knows if it can handle an architecture and a platform can be found using an architecture. Each platform can look at the arch, vendor and OS and know if it should be used or not. llvm-svn: 153104
Diffstat (limited to 'lldb/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp')
-rw-r--r--lldb/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp25
1 files changed, 23 insertions, 2 deletions
diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp
index 18cd4eb8f88..7a8884eba0a 100644
--- a/lldb/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp
+++ b/lldb/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp
@@ -60,9 +60,30 @@ PlatformiOSSimulator::Terminate ()
}
Platform*
-PlatformiOSSimulator::CreateInstance ()
+PlatformiOSSimulator::CreateInstance (bool force, const ArchSpec *arch)
{
- return new PlatformiOSSimulator ();
+ bool create = force;
+ if (create == false && arch && arch->IsValid())
+ {
+ switch (arch->GetMachine())
+ {
+ // Currently simulator is i386 only...
+ case llvm::Triple::x86:
+ {
+ const llvm::Triple &triple = arch->GetTriple();
+ const llvm::Triple::OSType os = triple.getOS();
+ const llvm::Triple::VendorType vendor = triple.getVendor();
+ if (os == llvm::Triple::Darwin && vendor == llvm::Triple::Apple)
+ create = true;
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ if (create)
+ return new PlatformiOSSimulator ();
+ return NULL;
}
OpenPOWER on IntegriCloud