LLDB
mainline
llvm-project
lldb
include
lldb
Interpreter
OptionValueArch.h
Go to the documentation of this file.
1
//===-- OptionValueArch.h -----------------------------------*- C++ -*-===//
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
#ifndef LLDB_INTERPRETER_OPTIONVALUEARCH_H
10
#define LLDB_INTERPRETER_OPTIONVALUEARCH_H
11
12
#include "
lldb/Interpreter/OptionValue.h
"
13
#include "
lldb/Utility/ArchSpec.h
"
14
#include "
lldb/Utility/CompletionRequest.h
"
15
16
namespace
lldb_private
{
17
18
class
OptionValueArch
:
public
Cloneable
<OptionValueArch, OptionValue> {
19
public
:
20
OptionValueArch
() =
default
;
21
22
OptionValueArch
(
const
char
*triple) :
m_current_value
(triple) {
23
m_default_value
=
m_current_value
;
24
}
25
26
OptionValueArch
(
const
ArchSpec
&value)
27
:
m_current_value
(value),
m_default_value
(value) {}
28
29
OptionValueArch
(
const
ArchSpec
¤t_value,
const
ArchSpec
&default_value)
30
:
m_current_value
(current_value),
m_default_value
(default_value) {}
31
32
~OptionValueArch
()
override
=
default
;
33
34
// Virtual subclass pure virtual overrides
35
36
OptionValue::Type
GetType
()
const override
{
return
eTypeArch
; }
37
38
void
DumpValue
(
const
ExecutionContext
*exe_ctx,
Stream
&strm,
39
uint32_t dump_mask)
override
;
40
41
Status
42
SetValueFromString
(llvm::StringRef value,
43
VarSetOperationType
op =
eVarSetOperationAssign
)
override
;
44
45
void
Clear
()
override
{
46
m_current_value
=
m_default_value
;
47
m_value_was_set
=
false
;
48
}
49
50
void
AutoComplete
(
CommandInterpreter
&interpreter,
51
lldb_private::CompletionRequest
&request)
override
;
52
53
// Subclass specific functions
54
55
ArchSpec
&
GetCurrentValue
() {
return
m_current_value
; }
56
57
const
ArchSpec
&
GetCurrentValue
()
const
{
return
m_current_value
; }
58
59
const
ArchSpec
&
GetDefaultValue
()
const
{
return
m_default_value
; }
60
61
void
SetCurrentValue
(
const
ArchSpec
&value,
bool
set_value_was_set) {
62
m_current_value
= value;
63
if
(set_value_was_set)
64
m_value_was_set
=
true
;
65
}
66
67
void
SetDefaultValue
(
const
ArchSpec
&value) {
m_default_value
= value; }
68
69
protected
:
70
ArchSpec
m_current_value
;
71
ArchSpec
m_default_value
;
72
};
73
74
}
// namespace lldb_private
75
76
#endif
// LLDB_INTERPRETER_OPTIONVALUEARCH_H
ArchSpec.h
CompletionRequest.h
OptionValue.h
lldb_private::ArchSpec
An architecture specification class.
Definition:
ArchSpec.h:31
lldb_private::Cloneable
A class that implements CRTP-based "virtual constructor" idiom.
Definition:
Cloneable.h:40
lldb_private::CommandInterpreter
Definition:
CommandInterpreter.h:231
lldb_private::CompletionRequest
"lldb/Utility/ArgCompletionRequest.h"
Definition:
CompletionRequest.h:100
lldb_private::ExecutionContext
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
Definition:
ExecutionContext.h:292
lldb_private::OptionValueArch
Definition:
OptionValueArch.h:18
lldb_private::OptionValueArch::OptionValueArch
OptionValueArch(const char *triple)
Definition:
OptionValueArch.h:22
lldb_private::OptionValueArch::GetDefaultValue
const ArchSpec & GetDefaultValue() const
Definition:
OptionValueArch.h:59
lldb_private::OptionValueArch::SetCurrentValue
void SetCurrentValue(const ArchSpec &value, bool set_value_was_set)
Definition:
OptionValueArch.h:61
lldb_private::OptionValueArch::Clear
void Clear() override
Definition:
OptionValueArch.h:45
lldb_private::OptionValueArch::AutoComplete
void AutoComplete(CommandInterpreter &interpreter, lldb_private::CompletionRequest &request) override
Definition:
OptionValueArch.cpp:67
lldb_private::OptionValueArch::GetCurrentValue
const ArchSpec & GetCurrentValue() const
Definition:
OptionValueArch.h:57
lldb_private::OptionValueArch::OptionValueArch
OptionValueArch(const ArchSpec ¤t_value, const ArchSpec &default_value)
Definition:
OptionValueArch.h:29
lldb_private::OptionValueArch::SetDefaultValue
void SetDefaultValue(const ArchSpec &value)
Definition:
OptionValueArch.h:67
lldb_private::OptionValueArch::~OptionValueArch
~OptionValueArch() override=default
lldb_private::OptionValueArch::SetValueFromString
Status SetValueFromString(llvm::StringRef value, VarSetOperationType op=eVarSetOperationAssign) override
Definition:
OptionValueArch.cpp:36
lldb_private::OptionValueArch::m_current_value
ArchSpec m_current_value
Definition:
OptionValueArch.h:70
lldb_private::OptionValueArch::GetCurrentValue
ArchSpec & GetCurrentValue()
Definition:
OptionValueArch.h:55
lldb_private::OptionValueArch::m_default_value
ArchSpec m_default_value
Definition:
OptionValueArch.h:71
lldb_private::OptionValueArch::GetType
OptionValue::Type GetType() const override
Definition:
OptionValueArch.h:36
lldb_private::OptionValueArch::OptionValueArch
OptionValueArch(const ArchSpec &value)
Definition:
OptionValueArch.h:26
lldb_private::OptionValueArch::DumpValue
void DumpValue(const ExecutionContext *exe_ctx, Stream &strm, uint32_t dump_mask) override
Definition:
OptionValueArch.cpp:20
lldb_private::OptionValueArch::OptionValueArch
OptionValueArch()=default
lldb_private::OptionValue::m_value_was_set
bool m_value_was_set
Definition:
OptionValue.h:346
lldb_private::OptionValue::Type
Type
Definition:
OptionValue.h:33
lldb_private::OptionValue::eTypeArch
@ eTypeArch
Definition:
OptionValue.h:35
lldb_private::Status
An error handling class.
Definition:
Status.h:44
lldb_private::Stream
A stream class that can stream formatted output to a file.
Definition:
Stream.h:28
lldb_private
A class that represents a running process on the host machine.
Definition:
SBAddressRange.h:14
lldb_private::VarSetOperationType
VarSetOperationType
Settable state variable types.
Definition:
lldb-private-enumerations.h:85
lldb_private::eVarSetOperationAssign
@ eVarSetOperationAssign
Definition:
lldb-private-enumerations.h:92
Generated on Wed Nov 20 2024 18:14:35 for LLDB by
1.9.6