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 // OptionGroupFormat
20 
22 public:
27 
29  lldb::Format default_format,
30  uint64_t default_byte_size =
31  UINT64_MAX, // Pass UINT64_MAX to disable the "--size" option
32  uint64_t default_count =
33  UINT64_MAX); // Pass UINT64_MAX to disable the "--count" option
34 
35  ~OptionGroupFormat() override = default;
36 
37  llvm::ArrayRef<OptionDefinition> GetDefinitions() override;
38 
39  Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_value,
40  ExecutionContext *execution_context) override;
41 
42  void OptionParsingStarting(ExecutionContext *execution_context) override;
43 
45 
47 
48  const OptionValueFormat &GetFormatValue() const { return m_format; }
49 
51 
52  const OptionValueUInt64 &GetByteSizeValue() const { return m_byte_size; }
53 
55 
56  const OptionValueUInt64 &GetCountValue() const { return m_count; }
57 
58  bool HasGDBFormat() const { return m_has_gdb_format; }
59 
60  bool AnyOptionWasSet() const {
63  }
64 
65 protected:
66  bool ParserGDBFormatLetter(ExecutionContext *execution_context,
67  char format_letter, lldb::Format &format,
68  uint32_t &byte_size);
69 
76 };
77 
78 } // namespace lldb_private
79 
80 #endif // LLDB_INTERPRETER_OPTIONGROUPFORMAT_H
lldb_private::OptionGroupFormat::OPTION_GROUP_GDB_FMT
static const uint32_t OPTION_GROUP_GDB_FMT
Definition: OptionGroupFormat.h:24
lldb_private::OptionGroupFormat::OptionParsingStarting
void OptionParsingStarting(ExecutionContext *execution_context) override
Definition: OptionGroupFormat.cpp:259
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:71
lldb_private::OptionGroupFormat::GetFormatValue
const OptionValueFormat & GetFormatValue() const
Definition: OptionGroupFormat.h:48
lldb_private::OptionGroupFormat::SetOptionValue
Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_value, ExecutionContext *execution_context) override
Definition: OptionGroupFormat.cpp:53
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:167
lldb_private::OptionGroupFormat::m_count
OptionValueUInt64 m_count
Definition: OptionGroupFormat.h:72
lldb_private::OptionGroupFormat::~OptionGroupFormat
~OptionGroupFormat() override=default
lldb_private::OptionGroup
Definition: Options.h:233
lldb_private::OptionGroupFormat::GetByteSizeValue
OptionValueUInt64 & GetByteSizeValue()
Definition: OptionGroupFormat.h:50
lldb_private::OptionGroupFormat::OptionGroupFormat
OptionGroupFormat(lldb::Format default_format, uint64_t default_byte_size=UINT64_MAX, uint64_t default_count=UINT64_MAX)
Definition: OptionGroupFormat.cpp:19
Options.h
lldb_private::OptionGroupFormat::m_has_gdb_format
bool m_has_gdb_format
Definition: OptionGroupFormat.h:75
lldb_private::OptionGroupFormat::m_prev_gdb_format
char m_prev_gdb_format
Definition: OptionGroupFormat.h:73
lldb_private::OptionValueFormat
Definition: OptionValueFormat.h:16
OptionValueFormat.h
lldb_private::OptionGroupFormat::GetCountValue
const OptionValueUInt64 & GetCountValue() const
Definition: OptionGroupFormat.h:56
lldb_private::OptionGroupFormat::GetByteSizeValue
const OptionValueUInt64 & GetByteSizeValue() const
Definition: OptionGroupFormat.h:52
LLDB_OPT_SET_1
#define LLDB_OPT_SET_1
Definition: lldb-defines.h:113
lldb_private::OptionGroupFormat
Definition: OptionGroupFormat.h:21
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:74
lldb_private::OptionGroupFormat::GetFormat
lldb::Format GetFormat() const
Definition: OptionGroupFormat.h:44
lldb_private::OptionGroupFormat::GetDefinitions
llvm::ArrayRef< OptionDefinition > GetDefinitions() override
Definition: OptionGroupFormat.cpp:42
lldb_private::OptionGroupFormat::GetCountValue
OptionValueUInt64 & GetCountValue()
Definition: OptionGroupFormat.h:54
lldb_private::OptionGroupFormat::m_format
OptionValueFormat m_format
Definition: OptionGroupFormat.h:70
lldb_private::OptionGroupFormat::OPTION_GROUP_SIZE
static const uint32_t OPTION_GROUP_SIZE
Definition: OptionGroupFormat.h:25
lldb_private::OptionGroupFormat::OPTION_GROUP_FORMAT
static const uint32_t OPTION_GROUP_FORMAT
Definition: OptionGroupFormat.h:23
lldb_private::OptionGroupFormat::HasGDBFormat
bool HasGDBFormat() const
Definition: OptionGroupFormat.h:58
lldb_private::Status
Definition: Status.h:44
lldb_private::OptionGroupFormat::GetFormatValue
OptionValueFormat & GetFormatValue()
Definition: OptionGroupFormat.h:46
uint32_t
lldb_private::OptionGroupFormat::AnyOptionWasSet
bool AnyOptionWasSet() const
Definition: OptionGroupFormat.h:60
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::OptionValueUInt64
Definition: OptionValueUInt64.h:17
lldb_private::OptionGroupFormat::OPTION_GROUP_COUNT
static const uint32_t OPTION_GROUP_COUNT
Definition: OptionGroupFormat.h:26
LLDB_OPT_SET_2
#define LLDB_OPT_SET_2
Definition: lldb-defines.h:114
UINT64_MAX
#define UINT64_MAX
Definition: lldb-defines.h:35