LLDB
mainline
llvm-project
lldb
source
Interpreter
OptionGroupMemoryTag.cpp
Go to the documentation of this file.
1
//===-- OptionGroupMemoryTag.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/OptionGroupMemoryTag.h
"
10
11
#include "
lldb/Host/OptionParser.h
"
12
13
using namespace
lldb
;
14
using namespace
lldb_private
;
15
16
static
const
uint32_t
SHORT_OPTION_SHOW_TAGS
= 0x54414753;
// 'tags'
17
18
OptionGroupMemoryTag::OptionGroupMemoryTag
(
bool
note_binary
/*=false*/
)
19
: m_show_tags(false, false), m_option_definition{
20
LLDB_OPT_SET_1
,
21
false,
22
"show-tags"
,
23
SHORT_OPTION_SHOW_TAGS
,
24
OptionParser
::eNoArgument,
25
nullptr,
26
{},
27
0,
28
eArgTypeNone
,
29
note_binary
30
?
"Include memory tags in output "
31
"(does not apply to binary output)."
32
:
"Include memory tags in output."
} {}
33
34
llvm::ArrayRef<OptionDefinition>
OptionGroupMemoryTag::GetDefinitions
() {
35
return
llvm::ArrayRef(
m_option_definition
);
36
}
37
38
Status
39
OptionGroupMemoryTag::SetOptionValue
(uint32_t option_idx,
40
llvm::StringRef option_arg,
41
ExecutionContext
*execution_context) {
42
assert(option_idx == 0 &&
"Only one option in memory tag group!"
);
43
44
switch
(
m_option_definition
.
short_option
) {
45
case
SHORT_OPTION_SHOW_TAGS
:
46
m_show_tags
.
SetCurrentValue
(
true
);
47
m_show_tags
.
SetOptionWasSet
();
48
break
;
49
50
default
:
51
llvm_unreachable(
"Unimplemented option"
);
52
}
53
54
return
{};
55
}
56
57
void
OptionGroupMemoryTag::OptionParsingStarting
(
58
ExecutionContext
*execution_context) {
59
m_show_tags
.
Clear
();
60
}
SHORT_OPTION_SHOW_TAGS
static const uint32_t SHORT_OPTION_SHOW_TAGS
Definition:
OptionGroupMemoryTag.cpp:16
OptionGroupMemoryTag.h
OptionParser.h
lldb_private::ExecutionContext
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
Definition:
ExecutionContext.h:292
lldb_private::OptionGroupMemoryTag::m_option_definition
OptionDefinition m_option_definition
Definition:
OptionGroupMemoryTag.h:39
lldb_private::OptionGroupMemoryTag::m_show_tags
OptionValueBoolean m_show_tags
Definition:
OptionGroupMemoryTag.h:38
lldb_private::OptionGroupMemoryTag::OptionParsingStarting
void OptionParsingStarting(ExecutionContext *execution_context) override
Definition:
OptionGroupMemoryTag.cpp:57
lldb_private::OptionGroupMemoryTag::OptionGroupMemoryTag
OptionGroupMemoryTag(bool note_binary=false)
Definition:
OptionGroupMemoryTag.cpp:18
lldb_private::OptionGroupMemoryTag::GetDefinitions
llvm::ArrayRef< OptionDefinition > GetDefinitions() override
Definition:
OptionGroupMemoryTag.cpp:34
lldb_private::OptionGroupMemoryTag::SetOptionValue
Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_value, ExecutionContext *execution_context) override
Definition:
OptionGroupMemoryTag.cpp:39
lldb_private::OptionParser
Definition:
OptionParser.h:33
lldb_private::OptionValueBoolean::SetCurrentValue
void SetCurrentValue(bool value)
Definition:
OptionValueBoolean.h:74
lldb_private::OptionValueBoolean::Clear
void Clear() override
Definition:
OptionValueBoolean.h:40
lldb_private::OptionValue::SetOptionWasSet
void SetOptionWasSet()
Definition:
OptionValue.h:256
lldb_private::Status
An error handling class.
Definition:
Status.h:115
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::eArgTypeNone
@ eArgTypeNone
Definition:
lldb-enumerations.h:638
lldb_private::OptionDefinition::short_option
int short_option
Single character for this option.
Definition:
OptionDefinition.h:32
Generated on Wed Dec 25 2024 05:14:20 for LLDB by
1.9.6