LLDB
mainline
llvm-project
lldb
source
Interpreter
OptionGroupUUID.cpp
Go to the documentation of this file.
1
//===-- OptionGroupUUID.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/OptionGroupUUID.h
"
10
11
#include "
lldb/Host/OptionParser.h
"
12
13
using namespace
lldb
;
14
using namespace
lldb_private
;
15
16
static
constexpr
OptionDefinition
g_option_table
[] = {
17
{
LLDB_OPT_SET_1
,
false
,
"uuid"
,
'u'
,
OptionParser::eRequiredArgument
,
18
nullptr
, {}, 0,
eArgTypeModuleUUID
,
"A module UUID value."
},
19
};
20
21
llvm::ArrayRef<OptionDefinition>
OptionGroupUUID::GetDefinitions
() {
22
return
llvm::ArrayRef(
g_option_table
);
23
}
24
25
Status
OptionGroupUUID::SetOptionValue
(uint32_t option_idx,
26
llvm::StringRef option_arg,
27
ExecutionContext
*execution_context) {
28
Status
error
;
29
const
int
short_option =
g_option_table
[option_idx].
short_option
;
30
31
switch
(short_option) {
32
case
'u'
:
33
error
=
m_uuid
.
SetValueFromString
(option_arg);
34
if
(
error
.Success())
35
m_uuid
.
SetOptionWasSet
();
36
break
;
37
38
default
:
39
llvm_unreachable(
"Unimplemented option"
);
40
}
41
42
return
error
;
43
}
44
45
void
OptionGroupUUID::OptionParsingStarting
(
46
ExecutionContext
*execution_context) {
47
m_uuid
.
Clear
();
48
}
error
static llvm::raw_ostream & error(Stream &strm)
Definition:
CommandReturnObject.cpp:17
g_option_table
static constexpr OptionDefinition g_option_table[]
Definition:
OptionGroupArchitecture.cpp:16
g_option_table
static constexpr OptionDefinition g_option_table[]
Definition:
OptionGroupUUID.cpp:16
OptionGroupUUID.h
OptionParser.h
lldb_private::ExecutionContext
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
Definition:
ExecutionContext.h:292
lldb_private::OptionGroupUUID::OptionParsingStarting
void OptionParsingStarting(ExecutionContext *execution_context) override
Definition:
OptionGroupUUID.cpp:45
lldb_private::OptionGroupUUID::m_uuid
OptionValueUUID m_uuid
Definition:
OptionGroupUUID.h:35
lldb_private::OptionGroupUUID::GetDefinitions
llvm::ArrayRef< OptionDefinition > GetDefinitions() override
Definition:
OptionGroupUUID.cpp:21
lldb_private::OptionGroupUUID::SetOptionValue
Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_value, ExecutionContext *execution_context) override
Definition:
OptionGroupUUID.cpp:25
lldb_private::OptionParser::eRequiredArgument
@ eRequiredArgument
Definition:
OptionParser.h:35
lldb_private::OptionValueUUID::SetValueFromString
Status SetValueFromString(llvm::StringRef value, VarSetOperationType op=eVarSetOperationAssign) override
Definition:
OptionValueUUID.cpp:30
lldb_private::OptionValueUUID::Clear
void Clear() override
Definition:
OptionValueUUID.h:40
lldb_private::OptionValue::SetOptionWasSet
void SetOptionWasSet()
Definition:
OptionValue.h:255
lldb_private::Status
An error handling class.
Definition:
Status.h:44
LLDB_OPT_SET_1
#define LLDB_OPT_SET_1
Definition:
lldb-defines.h:111
lldb_private
A class that represents a running process on the host machine.
Definition:
SBAddressRange.h:14
lldb
Definition:
SBAddress.h:15
lldb::eArgTypeModuleUUID
@ eArgTypeModuleUUID
Definition:
lldb-enumerations.h:646
lldb_private::OptionDefinition
Definition:
OptionDefinition.h:20
lldb_private::OptionDefinition::short_option
int short_option
Single character for this option.
Definition:
OptionDefinition.h:32
Generated on Wed Nov 20 2024 18:15:02 for LLDB by
1.9.6