Path: blob/main/contrib/llvm-project/lldb/source/Interpreter/CommandOptionValidators.cpp
39587 views
//===-- CommandOptionValidators.cpp ---------------------------------------===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//78#include "lldb/Interpreter/CommandOptionValidators.h"910#include "lldb/Interpreter/CommandInterpreter.h"11#include "lldb/Target/Platform.h"1213using namespace lldb;14using namespace lldb_private;1516bool PosixPlatformCommandOptionValidator::IsValid(17Platform &platform, const ExecutionContext &target) const {18llvm::Triple::OSType os =19platform.GetSystemArchitecture().GetTriple().getOS();20switch (os) {21// Are there any other platforms that are not POSIX-compatible?22case llvm::Triple::Win32:23return false;24default:25return true;26}27}2829const char *PosixPlatformCommandOptionValidator::ShortConditionString() const {30return "POSIX";31}3233const char *PosixPlatformCommandOptionValidator::LongConditionString() const {34return "Option only valid for POSIX-compliant hosts.";35}363738