aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/lldb/source/Interpreter/CommandOptionValidators.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2019-12-20 19:53:05 +0000
committerDimitry Andric <dim@FreeBSD.org>2019-12-20 19:53:05 +0000
commit0b57cec536236d46e3dba9bd041533462f33dbb7 (patch)
tree56229dbdbbf76d18580f72f789003db17246c8d9 /contrib/llvm-project/lldb/source/Interpreter/CommandOptionValidators.cpp
parent718ef55ec7785aae63f98f8ca05dc07ed399c16d (diff)
Notes
Diffstat (limited to 'contrib/llvm-project/lldb/source/Interpreter/CommandOptionValidators.cpp')
-rw-r--r--contrib/llvm-project/lldb/source/Interpreter/CommandOptionValidators.cpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/contrib/llvm-project/lldb/source/Interpreter/CommandOptionValidators.cpp b/contrib/llvm-project/lldb/source/Interpreter/CommandOptionValidators.cpp
new file mode 100644
index 000000000000..c41c1566aab9
--- /dev/null
+++ b/contrib/llvm-project/lldb/source/Interpreter/CommandOptionValidators.cpp
@@ -0,0 +1,36 @@
+//===-- CommandOptionValidators.cpp -----------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "lldb/Interpreter/CommandOptionValidators.h"
+
+#include "lldb/Interpreter/CommandInterpreter.h"
+#include "lldb/Target/Platform.h"
+
+using namespace lldb;
+using namespace lldb_private;
+
+bool PosixPlatformCommandOptionValidator::IsValid(
+ Platform &platform, const ExecutionContext &target) const {
+ llvm::Triple::OSType os =
+ platform.GetSystemArchitecture().GetTriple().getOS();
+ switch (os) {
+ // Are there any other platforms that are not POSIX-compatible?
+ case llvm::Triple::Win32:
+ return false;
+ default:
+ return true;
+ }
+}
+
+const char *PosixPlatformCommandOptionValidator::ShortConditionString() const {
+ return "POSIX";
+}
+
+const char *PosixPlatformCommandOptionValidator::LongConditionString() const {
+ return "Option only valid for POSIX-compliant hosts.";
+}