LLDB mainline
OptionGroupFormat.h
Go to the documentation of this file.
1//===-- OptionGroupFormat.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_OPTIONGROUPFORMAT_H
10#define LLDB_INTERPRETER_OPTIONGROUPFORMAT_H
11
16
17namespace lldb_private {
18
19typedef std::vector<std::tuple<lldb::CommandArgumentType, const char *>>
21
22// OptionGroupFormat
23
25public:
26 static const uint32_t OPTION_GROUP_FORMAT = LLDB_OPT_SET_1;
27 static const uint32_t OPTION_GROUP_GDB_FMT = LLDB_OPT_SET_2;
28 static const uint32_t OPTION_GROUP_SIZE = LLDB_OPT_SET_3;
29 static const uint32_t OPTION_GROUP_COUNT = LLDB_OPT_SET_4;
30
32 lldb::Format default_format,
33 uint64_t default_byte_size =
34 UINT64_MAX, // Pass UINT64_MAX to disable the "--size" option
35 uint64_t default_count =
36 UINT64_MAX, // Pass UINT64_MAX to disable the "--count" option
37 OptionGroupFormatUsageTextVector usage_text_vector = {}
38 // Use to override default option usage text with the command specific one
39 );
40
41 ~OptionGroupFormat() override = default;
42
43 llvm::ArrayRef<OptionDefinition> GetDefinitions() override;
44
45 Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_value,
46 ExecutionContext *execution_context) override;
47
48 void OptionParsingStarting(ExecutionContext *execution_context) override;
49
51
53
54 const OptionValueFormat &GetFormatValue() const { return m_format; }
55
57
59
61
62 const OptionValueUInt64 &GetCountValue() const { return m_count; }
63
64 bool HasGDBFormat() const { return m_has_gdb_format; }
65
66 bool AnyOptionWasSet() const {
69 }
70
71protected:
72 bool ParserGDBFormatLetter(ExecutionContext *execution_context,
73 char format_letter, lldb::Format &format,
74 uint32_t &byte_size);
75
83};
84
85} // namespace lldb_private
86
87#endif // LLDB_INTERPRETER_OPTIONGROUPFORMAT_H
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_value, ExecutionContext *execution_context) override
static const uint32_t OPTION_GROUP_GDB_FMT
const OptionValueUInt64 & GetByteSizeValue() const
OptionValueUInt64 & GetByteSizeValue()
bool ParserGDBFormatLetter(ExecutionContext *execution_context, char format_letter, lldb::Format &format, uint32_t &byte_size)
void OptionParsingStarting(ExecutionContext *execution_context) override
~OptionGroupFormat() override=default
static const uint32_t OPTION_GROUP_FORMAT
const OptionValueFormat & GetFormatValue() const
OptionDefinition m_option_definitions[4]
static const uint32_t OPTION_GROUP_COUNT
llvm::ArrayRef< OptionDefinition > GetDefinitions() override
static const uint32_t OPTION_GROUP_SIZE
OptionValueFormat & GetFormatValue()
const OptionValueUInt64 & GetCountValue() const
OptionValueUInt64 & GetCountValue()
lldb::Format GetCurrentValue() const
An error handling class.
Definition: Status.h:44
#define LLDB_OPT_SET_1
Definition: lldb-defines.h:111
#define UINT64_MAX
Definition: lldb-defines.h:23
#define LLDB_OPT_SET_2
Definition: lldb-defines.h:112
#define LLDB_OPT_SET_3
Definition: lldb-defines.h:113
#define LLDB_OPT_SET_4
Definition: lldb-defines.h:114
A class that represents a running process on the host machine.
std::vector< std::tuple< lldb::CommandArgumentType, const char * > > OptionGroupFormatUsageTextVector
Format
Display format definitions.