LLDB
mainline
llvm-project
lldb
include
lldb
Interpreter
OptionGroupPythonClassWithDict.h
Go to the documentation of this file.
1
//===-- OptionGroupPythonClassWithDict.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_OPTIONGROUPPYTHONCLASSWITHDICT_H
10
#define LLDB_INTERPRETER_OPTIONGROUPPYTHONCLASSWITHDICT_H
11
12
#include "
lldb/Interpreter/Options.h
"
13
#include "
lldb/Utility/Flags.h
"
14
#include "
lldb/Utility/StructuredData.h
"
15
#include "
lldb/lldb-types.h
"
16
17
namespace
lldb_private
{
18
19
// Use this Option group if you have a python class that implements some
20
// Python extension point, and you pass a SBStructuredData to the class
21
// __init__ method.
22
// class_option specifies the class name
23
// the key and value options are read in in pairs, and a
24
// StructuredData::Dictionary is constructed with those pairs.
25
class
OptionGroupPythonClassWithDict
:
public
OptionGroup
{
26
public
:
27
enum
OptionKind
{
28
eScriptClass
= 1 << 0,
29
eDictKey
= 1 << 1,
30
eDictValue
= 1 << 2,
31
ePythonFunction
= 1 << 3,
32
eAllOptions
= (
eScriptClass
|
eDictKey
|
eDictValue
|
ePythonFunction
)
33
};
34
35
OptionGroupPythonClassWithDict
(
const
char
*class_use,
bool
is_class =
true
,
36
int
class_option =
'C'
,
int
key_option =
'k'
,
37
int
value_option =
'v'
,
38
uint16_t required_options =
eScriptClass
|
39
ePythonFunction
);
40
41
~OptionGroupPythonClassWithDict
()
override
=
default
;
42
43
llvm::ArrayRef<OptionDefinition>
GetDefinitions
()
override
{
44
return
llvm::ArrayRef<OptionDefinition>(
m_option_definition
);
45
}
46
47
Status
SetOptionValue
(uint32_t option_idx, llvm::StringRef option_value,
48
ExecutionContext
*execution_context)
override
;
49
50
void
OptionParsingStarting
(
ExecutionContext
*execution_context)
override
;
51
Status
OptionParsingFinished
(
ExecutionContext
*execution_context)
override
;
52
53
const
StructuredData::DictionarySP
GetStructuredData
() {
54
return
m_dict_sp
;
55
}
56
const
std::string &
GetName
() {
57
return
m_name
;
58
}
59
60
protected
:
61
std::string
m_name
;
62
std::string
m_current_key
;
63
StructuredData::DictionarySP
m_dict_sp
;
64
std::string
m_class_usage_text
,
m_key_usage_text
,
m_value_usage_text
;
65
bool
m_is_class
;
66
OptionDefinition
m_option_definition
[4];
67
Flags
m_required_options
;
68
};
69
70
}
// namespace lldb_private
71
72
#endif
// LLDB_INTERPRETER_OPTIONGROUPPYTHONCLASSWITHDICT_H
Flags.h
Options.h
StructuredData.h
lldb_private::ExecutionContext
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
Definition:
ExecutionContext.h:292
lldb_private::Flags
A class to manage flags.
Definition:
Flags.h:22
lldb_private::OptionGroupPythonClassWithDict
Definition:
OptionGroupPythonClassWithDict.h:25
lldb_private::OptionGroupPythonClassWithDict::OptionKind
OptionKind
Definition:
OptionGroupPythonClassWithDict.h:27
lldb_private::OptionGroupPythonClassWithDict::eDictValue
@ eDictValue
Definition:
OptionGroupPythonClassWithDict.h:30
lldb_private::OptionGroupPythonClassWithDict::eScriptClass
@ eScriptClass
Definition:
OptionGroupPythonClassWithDict.h:28
lldb_private::OptionGroupPythonClassWithDict::eDictKey
@ eDictKey
Definition:
OptionGroupPythonClassWithDict.h:29
lldb_private::OptionGroupPythonClassWithDict::eAllOptions
@ eAllOptions
Definition:
OptionGroupPythonClassWithDict.h:32
lldb_private::OptionGroupPythonClassWithDict::ePythonFunction
@ ePythonFunction
Definition:
OptionGroupPythonClassWithDict.h:31
lldb_private::OptionGroupPythonClassWithDict::m_name
std::string m_name
Definition:
OptionGroupPythonClassWithDict.h:61
lldb_private::OptionGroupPythonClassWithDict::GetDefinitions
llvm::ArrayRef< OptionDefinition > GetDefinitions() override
Definition:
OptionGroupPythonClassWithDict.h:43
lldb_private::OptionGroupPythonClassWithDict::m_key_usage_text
std::string m_key_usage_text
Definition:
OptionGroupPythonClassWithDict.h:64
lldb_private::OptionGroupPythonClassWithDict::m_option_definition
OptionDefinition m_option_definition[4]
Definition:
OptionGroupPythonClassWithDict.h:66
lldb_private::OptionGroupPythonClassWithDict::GetName
const std::string & GetName()
Definition:
OptionGroupPythonClassWithDict.h:56
lldb_private::OptionGroupPythonClassWithDict::OptionParsingStarting
void OptionParsingStarting(ExecutionContext *execution_context) override
Definition:
OptionGroupPythonClassWithDict.cpp:136
lldb_private::OptionGroupPythonClassWithDict::SetOptionValue
Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_value, ExecutionContext *execution_context) override
Definition:
OptionGroupPythonClassWithDict.cpp:81
lldb_private::OptionGroupPythonClassWithDict::m_dict_sp
StructuredData::DictionarySP m_dict_sp
Definition:
OptionGroupPythonClassWithDict.h:63
lldb_private::OptionGroupPythonClassWithDict::GetStructuredData
const StructuredData::DictionarySP GetStructuredData()
Definition:
OptionGroupPythonClassWithDict.h:53
lldb_private::OptionGroupPythonClassWithDict::m_class_usage_text
std::string m_class_usage_text
Definition:
OptionGroupPythonClassWithDict.h:64
lldb_private::OptionGroupPythonClassWithDict::m_current_key
std::string m_current_key
Definition:
OptionGroupPythonClassWithDict.h:62
lldb_private::OptionGroupPythonClassWithDict::m_required_options
Flags m_required_options
Definition:
OptionGroupPythonClassWithDict.h:67
lldb_private::OptionGroupPythonClassWithDict::~OptionGroupPythonClassWithDict
~OptionGroupPythonClassWithDict() override=default
lldb_private::OptionGroupPythonClassWithDict::m_value_usage_text
std::string m_value_usage_text
Definition:
OptionGroupPythonClassWithDict.h:64
lldb_private::OptionGroupPythonClassWithDict::m_is_class
bool m_is_class
Definition:
OptionGroupPythonClassWithDict.h:65
lldb_private::OptionGroupPythonClassWithDict::OptionParsingFinished
Status OptionParsingFinished(ExecutionContext *execution_context) override
Definition:
OptionGroupPythonClassWithDict.cpp:146
lldb_private::OptionGroup
Definition:
Options.h:234
lldb_private::Status
An error handling class.
Definition:
Status.h:115
lldb_private::StructuredData::DictionarySP
std::shared_ptr< Dictionary > DictionarySP
Definition:
StructuredData.h:73
lldb-types.h
lldb_private
A class that represents a running process on the host machine.
Definition:
SBAddressRange.h:14
lldb_private::OptionDefinition
Definition:
OptionDefinition.h:20
Generated on Fri Dec 20 2024 17:26:47 for LLDB by
1.9.6