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 
17 namespace lldb_private {
18 
19 typedef std::vector<std::tuple<lldb::CommandArgumentType, const char *>>
21 
22 // OptionGroupFormat
23 
25 public:
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 
58  const OptionValueUInt64 &GetByteSizeValue() const { return m_byte_size; }
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 
71 protected:
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_private::OptionGroupFormat::OPTION_GROUP_GDB_FMT
static const uint32_t OPTION_GROUP_GDB_FMT
Definition: OptionGroupFormat.h:27
lldb_private::OptionGroupFormat::OptionParsingStarting
void OptionParsingStarting(ExecutionContext *execution_context) override
Definition: OptionGroupFormat.cpp:277
lldb_private::ExecutionContext
Definition: ExecutionContext.h:292
lldb_private::OptionValueFormat::GetCurrentValue
lldb::Format GetCurrentValue() const
Definition: OptionValueFormat.h:45
lldb_private::OptionValue::OptionWasSet
bool OptionWasSet() const
Definition: OptionValue.h:303
lldb::Format
Format
Display format definitions.
Definition: lldb-enumerations.h:155
lldb_private::OptionGroupFormat::m_byte_size
OptionValueUInt64 m_byte_size
Definition: OptionGroupFormat.h:77
lldb_private::OptionGroupFormat::GetFormatValue
const OptionValueFormat & GetFormatValue() const
Definition: OptionGroupFormat.h:54
lldb_private::OptionGroupFormat::SetOptionValue
Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_value, ExecutionContext *execution_context) override
Definition: OptionGroupFormat.cpp:71
OptionValueSInt64.h
OptionValueUInt64.h
lldb_private::OptionGroupFormat::ParserGDBFormatLetter
bool ParserGDBFormatLetter(ExecutionContext *execution_context, char format_letter, lldb::Format &format, uint32_t &byte_size)
Definition: OptionGroupFormat.cpp:185
lldb_private::OptionGroupFormat::m_count
OptionValueUInt64 m_count
Definition: OptionGroupFormat.h:78
lldb_private::OptionGroupFormat::~OptionGroupFormat
~OptionGroupFormat() override=default
lldb_private::OptionGroup
Definition: Options.h:233
lldb_private::OptionGroupFormat::GetByteSizeValue
OptionValueUInt64 & GetByteSizeValue()
Definition: OptionGroupFormat.h:56
Options.h
lldb_private::OptionGroupFormat::m_has_gdb_format
bool m_has_gdb_format
Definition: OptionGroupFormat.h:81
lldb_private::OptionGroupFormat::m_prev_gdb_format
char m_prev_gdb_format
Definition: OptionGroupFormat.h:79
lldb_private::OptionValueFormat
Definition: OptionValueFormat.h:16
OptionValueFormat.h
lldb_private::OptionGroupFormat::GetCountValue
const OptionValueUInt64 & GetCountValue() const
Definition: OptionGroupFormat.h:62
lldb_private::OptionGroupFormat::GetByteSizeValue
const OptionValueUInt64 & GetByteSizeValue() const
Definition: OptionGroupFormat.h:58
LLDB_OPT_SET_1
#define LLDB_OPT_SET_1
Definition: lldb-defines.h:113
lldb_private::OptionGroupFormat
Definition: OptionGroupFormat.h:24
LLDB_OPT_SET_3
#define LLDB_OPT_SET_3
Definition: lldb-defines.h:115
lldb_private::OptionGroupFormat::m_prev_gdb_size
char m_prev_gdb_size
Definition: OptionGroupFormat.h:80
lldb_private::OptionGroupFormat::GetFormat
lldb::Format GetFormat() const
Definition: OptionGroupFormat.h:50
lldb_private::OptionGroupFormat::m_option_definitions
OptionDefinition m_option_definitions[4]
Definition: OptionGroupFormat.h:82
lldb_private::OptionGroupFormat::GetDefinitions
llvm::ArrayRef< OptionDefinition > GetDefinitions() override
Definition: OptionGroupFormat.cpp:60
lldb_private::OptionGroupFormat::GetCountValue
OptionValueUInt64 & GetCountValue()
Definition: OptionGroupFormat.h:60
lldb_private::OptionGroupFormat::OptionGroupFormat
OptionGroupFormat(lldb::Format default_format, uint64_t default_byte_size=UINT64_MAX, uint64_t default_count=UINT64_MAX, OptionGroupFormatUsageTextVector usage_text_vector={})
Definition: OptionGroupFormat.cpp:34
lldb_private::OptionGroupFormat::m_format
OptionValueFormat m_format
Definition: OptionGroupFormat.h:76
lldb_private::OptionGroupFormat::OPTION_GROUP_SIZE
static const uint32_t OPTION_GROUP_SIZE
Definition: OptionGroupFormat.h:28
lldb_private::OptionGroupFormat::OPTION_GROUP_FORMAT
static const uint32_t OPTION_GROUP_FORMAT
Definition: OptionGroupFormat.h:26
lldb_private::OptionGroupFormat::HasGDBFormat
bool HasGDBFormat() const
Definition: OptionGroupFormat.h:64
lldb_private::Status
Definition: Status.h:44
lldb_private::OptionGroupFormat::GetFormatValue
OptionValueFormat & GetFormatValue()
Definition: OptionGroupFormat.h:52
uint32_t
lldb_private::OptionGroupFormat::AnyOptionWasSet
bool AnyOptionWasSet() const
Definition: OptionGroupFormat.h:66
lldb_private::OptionGroupFormatUsageTextVector
std::vector< std::tuple< lldb::CommandArgumentType, const char * > > OptionGroupFormatUsageTextVector
Definition: OptionGroupFormat.h:20
LLDB_OPT_SET_4
#define LLDB_OPT_SET_4
Definition: lldb-defines.h:116
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::OptionDefinition
Definition: OptionDefinition.h:20
lldb_private::OptionValueUInt64
Definition: OptionValueUInt64.h:17
lldb_private::OptionGroupFormat::OPTION_GROUP_COUNT
static const uint32_t OPTION_GROUP_COUNT
Definition: OptionGroupFormat.h:29
LLDB_OPT_SET_2
#define LLDB_OPT_SET_2
Definition: lldb-defines.h:114
UINT64_MAX
#define UINT64_MAX
Definition: lldb-defines.h:35