summaryrefslogtreecommitdiffstats
path: root/lldb/source/Interpreter/CommandOptionValidators.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2014-07-07 23:54:51 +0000
committerZachary Turner <zturner@google.com>2014-07-07 23:54:51 +0000
commit28638911cd79f9808edc5f297b16403b8ff370bc (patch)
tree72569e427392be44160ac975cb7dd0ea978f5c22 /lldb/source/Interpreter/CommandOptionValidators.cpp
parente7a8ccfaad752f02b4f0e3bf49321b9f23313a75 (diff)
downloadbcm5719-llvm-28638911cd79f9808edc5f297b16403b8ff370bc.tar.gz
bcm5719-llvm-28638911cd79f9808edc5f297b16403b8ff370bc.zip
Invalidate process UID/GID-related command options on Windows.
Windows uses a different process security model and does not have a concept of process UID or GID. This patch makes these options invalid on Windows. Attempting to specify these options when the current platform is Windows will generate an error. Reviewed by: Jim Ingham Differential Revision: http://reviews.llvm.org/D4373 llvm-svn: 212500
Diffstat (limited to 'lldb/source/Interpreter/CommandOptionValidators.cpp')
-rw-r--r--lldb/source/Interpreter/CommandOptionValidators.cpp39
1 files changed, 39 insertions, 0 deletions
diff --git a/lldb/source/Interpreter/CommandOptionValidators.cpp b/lldb/source/Interpreter/CommandOptionValidators.cpp
new file mode 100644
index 00000000000..c9f3e3b4635
--- /dev/null
+++ b/lldb/source/Interpreter/CommandOptionValidators.cpp
@@ -0,0 +1,39 @@
+//===-- CommandOptionValidators.cpp -----------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#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, 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.";
+}
OpenPOWER on IntegriCloud