summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.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/FreeBSD/PlatformFreeBSD.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/FreeBSD/PlatformFreeBSD.cpp')
-rw-r--r--lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp b/lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp
index ecc96c34b48..f64235da80c 100644
--- a/lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp
+++ b/lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp
@@ -25,9 +25,20 @@ using namespace lldb;
using namespace lldb_private;
Platform *
-PlatformFreeBSD::CreateInstance ()
+PlatformFreeBSD::CreateInstance (bool force, const lldb_private::ArchSpec *arch)
{
- return new PlatformFreeBSD (true);
+ bool create = force;
+ if (create == false && arch && arch->IsValid())
+ {
+ const llvm::Triple &triple = arch->GetTriple();
+ const llvm::Triple::OSType os = triple.getOS();
+ if (os == llvm::Triple::FreeBSD || os == llvm::Triple::KFreeBSD)
+ create = true;
+ }
+ if (create)
+ return new PlatformFreeBSD (true);
+ return NULL;
+
}
const char *
OpenPOWER on IntegriCloud