LLDB
mainline
llvm-project
lldb
source
Interpreter
CommandOptionValidators.cpp
Go to the documentation of this file.
1
//===-- CommandOptionValidators.cpp ---------------------------------------===//
2
//
3
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
// See https://llvm.org/LICENSE.txt for license information.
5
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
//
7
//===----------------------------------------------------------------------===//
8
9
#include "
lldb/Interpreter/CommandOptionValidators.h
"
10
11
#include "
lldb/Interpreter/CommandInterpreter.h
"
12
#include "
lldb/Target/Platform.h
"
13
14
using namespace
lldb
;
15
using namespace
lldb_private
;
16
17
bool
PosixPlatformCommandOptionValidator::IsValid
(
18
Platform
&platform,
const
ExecutionContext
&target)
const
{
19
llvm::Triple::OSType os =
20
platform.
GetSystemArchitecture
().
GetTriple
().getOS();
21
switch
(os) {
22
// Are there any other platforms that are not POSIX-compatible?
23
case
llvm::Triple::Win32:
24
return
false
;
25
default
:
26
return
true
;
27
}
28
}
29
30
const
char
*
PosixPlatformCommandOptionValidator::ShortConditionString
()
const
{
31
return
"POSIX"
;
32
}
33
34
const
char
*
PosixPlatformCommandOptionValidator::LongConditionString
()
const
{
35
return
"Option only valid for POSIX-compliant hosts."
;
36
}
CommandInterpreter.h
CommandOptionValidators.h
Platform.h
lldb_private::ArchSpec::GetTriple
llvm::Triple & GetTriple()
Architecture triple accessor.
Definition:
ArchSpec.h:450
lldb_private::ExecutionContext
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
Definition:
ExecutionContext.h:292
lldb_private::Platform
A plug-in interface definition class for debug platform that includes many platform abilities such as...
Definition:
Platform.h:76
lldb_private::Platform::GetSystemArchitecture
const ArchSpec & GetSystemArchitecture()
Definition:
Platform.cpp:813
lldb_private::PosixPlatformCommandOptionValidator::ShortConditionString
const char * ShortConditionString() const override
Definition:
CommandOptionValidators.cpp:30
lldb_private::PosixPlatformCommandOptionValidator::IsValid
bool IsValid(Platform &platform, const ExecutionContext &target) const override
Definition:
CommandOptionValidators.cpp:17
lldb_private::PosixPlatformCommandOptionValidator::LongConditionString
const char * LongConditionString() const override
Definition:
CommandOptionValidators.cpp:34
lldb_private
A class that represents a running process on the host machine.
Definition:
SBAddressRange.h:14
lldb
Definition:
SBAddress.h:15
Generated on Wed Nov 20 2024 18:15:02 for LLDB by
1.9.6