LLDB
mainline
llvm-project
lldb
include
lldb
Interpreter
Property.h
Go to the documentation of this file.
1
//===-- Property.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_PROPERTY_H
10
#define LLDB_INTERPRETER_PROPERTY_H
11
12
#include "
lldb/Interpreter/OptionValue.h
"
13
#include "
lldb/Utility/Flags.h
"
14
#include "
lldb/lldb-defines.h
"
15
#include "
lldb/lldb-private-types.h
"
16
17
#include <string>
18
19
namespace
lldb_private
{
20
21
// A structure that can be used to create a global table for all properties.
22
// Property class instances can be constructed using one of these.
23
struct
PropertyDefinition
{
24
const
char
*
name
;
25
OptionValue::Type
type
;
26
bool
global
;
// false == this setting is a global setting by default
27
uintptr_t
default_uint_value
;
28
const
char
*
default_cstr_value
;
29
OptionEnumValues
enum_values
;
30
const
char
*
description
;
31
};
32
33
using
PropertyDefinitions
= llvm::ArrayRef<PropertyDefinition>;
34
35
class
Property
{
36
public
:
37
Property
(
const
PropertyDefinition
&definition);
38
39
Property
(llvm::StringRef name, llvm::StringRef desc,
bool
is_global,
40
const
lldb::OptionValueSP
&value_sp);
41
42
llvm::StringRef
GetName
()
const
{
return
m_name
; }
43
llvm::StringRef
GetDescription
()
const
{
return
m_description
; }
44
45
const
lldb::OptionValueSP
&
GetValue
()
const
{
return
m_value_sp
; }
46
47
void
SetOptionValue
(
const
lldb::OptionValueSP
&value_sp) {
48
m_value_sp
= value_sp;
49
}
50
51
bool
IsValid
()
const
{
return
(
bool
)
m_value_sp
; }
52
53
bool
IsGlobal
()
const
{
return
m_is_global
; }
54
55
void
Dump
(
const
ExecutionContext
*exe_ctx,
Stream
&strm,
56
uint32_t dump_mask)
const
;
57
58
bool
DumpQualifiedName
(
Stream
&strm)
const
;
59
60
void
DumpDescription
(
CommandInterpreter
&interpreter,
Stream
&strm,
61
uint32_t output_width,
62
bool
display_qualified_name)
const
;
63
64
void
SetValueChangedCallback
(std::function<
void
()> callback);
65
66
protected
:
67
std::string
m_name
;
68
std::string
m_description
;
69
lldb::OptionValueSP
m_value_sp
;
70
bool
m_is_global
;
71
};
72
73
}
// namespace lldb_private
74
75
#endif
// LLDB_INTERPRETER_PROPERTY_H
Flags.h
OptionValue.h
lldb_private::CommandInterpreter
Definition:
CommandInterpreter.h:231
lldb_private::ExecutionContext
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
Definition:
ExecutionContext.h:292
lldb_private::OptionValue::Type
Type
Definition:
OptionValue.h:33
lldb_private::Property
Definition:
Property.h:35
lldb_private::Property::GetName
llvm::StringRef GetName() const
Definition:
Property.h:42
lldb_private::Property::DumpDescription
void DumpDescription(CommandInterpreter &interpreter, Stream &strm, uint32_t output_width, bool display_qualified_name) const
Definition:
Property.cpp:275
lldb_private::Property::IsGlobal
bool IsGlobal() const
Definition:
Property.h:53
lldb_private::Property::GetValue
const lldb::OptionValueSP & GetValue() const
Definition:
Property.h:45
lldb_private::Property::SetOptionValue
void SetOptionValue(const lldb::OptionValueSP &value_sp)
Definition:
Property.h:47
lldb_private::Property::GetDescription
llvm::StringRef GetDescription() const
Definition:
Property.h:43
lldb_private::Property::m_is_global
bool m_is_global
Definition:
Property.h:70
lldb_private::Property::m_name
std::string m_name
Definition:
Property.h:67
lldb_private::Property::m_value_sp
lldb::OptionValueSP m_value_sp
Definition:
Property.h:69
lldb_private::Property::SetValueChangedCallback
void SetValueChangedCallback(std::function< void()> callback)
Definition:
Property.cpp:306
lldb_private::Property::Dump
void Dump(const ExecutionContext *exe_ctx, Stream &strm, uint32_t dump_mask) const
Definition:
Property.cpp:247
lldb_private::Property::DumpQualifiedName
bool DumpQualifiedName(Stream &strm) const
Definition:
Property.cpp:237
lldb_private::Property::m_description
std::string m_description
Definition:
Property.h:68
lldb_private::Property::IsValid
bool IsValid() const
Definition:
Property.h:51
lldb_private::Stream
A stream class that can stream formatted output to a file.
Definition:
Stream.h:28
lldb-defines.h
lldb-private-types.h
lldb_private
A class that represents a running process on the host machine.
Definition:
SBAddressRange.h:14
lldb_private::PropertyDefinitions
llvm::ArrayRef< PropertyDefinition > PropertyDefinitions
Definition:
Property.h:33
lldb_private::OptionEnumValues
llvm::ArrayRef< OptionEnumValueElement > OptionEnumValues
Definition:
lldb-private-types.h:127
lldb::OptionValueSP
std::shared_ptr< lldb_private::OptionValue > OptionValueSP
Definition:
lldb-forward.h:382
lldb_private::PropertyDefinition
Definition:
Property.h:23
lldb_private::PropertyDefinition::default_cstr_value
const char * default_cstr_value
Definition:
Property.h:28
lldb_private::PropertyDefinition::enum_values
OptionEnumValues enum_values
Definition:
Property.h:29
lldb_private::PropertyDefinition::description
const char * description
Definition:
Property.h:30
lldb_private::PropertyDefinition::default_uint_value
uintptr_t default_uint_value
Definition:
Property.h:27
lldb_private::PropertyDefinition::type
OptionValue::Type type
Definition:
Property.h:25
lldb_private::PropertyDefinition::global
bool global
Definition:
Property.h:26
lldb_private::PropertyDefinition::name
const char * name
Definition:
Property.h:24
Generated on Fri Nov 22 2024 09:34:25 for LLDB by
1.9.6