LLDB  mainline
OptionGroupUInt64.cpp
Go to the documentation of this file.
1 //===-- OptionGroupUInt64.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 
10 
11 #include "lldb/Host/OptionParser.h"
12 
13 using namespace lldb;
14 using namespace lldb_private;
15 
16 OptionGroupUInt64::OptionGroupUInt64(uint32_t usage_mask, bool required,
17  const char *long_option, int short_option,
18  uint32_t completion_type,
19  lldb::CommandArgumentType argument_type,
20  const char *usage_text,
21  uint64_t default_value)
22  : m_value(default_value, default_value) {
23  m_option_definition.usage_mask = usage_mask;
24  m_option_definition.required = required;
25  m_option_definition.long_option = long_option;
26  m_option_definition.short_option = short_option;
30  m_option_definition.completion_type = completion_type;
31  m_option_definition.argument_type = argument_type;
32  m_option_definition.usage_text = usage_text;
33 }
34 
36  llvm::StringRef option_arg,
37  ExecutionContext *execution_context) {
39  return error;
40 }
41 
43  ExecutionContext *execution_context) {
44  m_value.Clear();
45 }
lldb_private::ExecutionContext
Definition: ExecutionContext.h:292
lldb_private::OptionDefinition::required
bool required
This option is required (in the current usage level).
Definition: OptionDefinition.h:25
lldb_private::OptionGroupUInt64::m_value
OptionValueUInt64 m_value
Definition: OptionGroupUInt64.h:42
lldb_private::OptionDefinition::validator
OptionValidator * validator
If non-NULL, option is valid iff |validator->IsValid()|, otherwise always valid.
Definition: OptionDefinition.h:37
error
static llvm::raw_ostream & error(Stream &strm)
Definition: CommandReturnObject.cpp:17
lldb_private::OptionDefinition::completion_type
uint32_t completion_type
The kind of completion for this option.
Definition: OptionDefinition.h:42
lldb::CommandArgumentType
CommandArgumentType
Definition: lldb-enumerations.h:515
lldb_private::OptionDefinition::usage_text
const char * usage_text
Full text explaining what this options does and what (if any) argument to pass it.
Definition: OptionDefinition.h:47
lldb_private::OptionDefinition::long_option
const char * long_option
Full name for this option.
Definition: OptionDefinition.h:27
lldb_private::OptionDefinition::option_has_arg
int option_has_arg
no_argument, required_argument or optional_argument
Definition: OptionDefinition.h:34
OptionGroupUInt64.h
lldb_private::OptionValueUInt64::Clear
void Clear() override
Definition: OptionValueUInt64.h:45
lldb_private::OptionGroupUInt64::SetOptionValue
Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_value, ExecutionContext *execution_context) override
Definition: OptionGroupUInt64.cpp:35
lldb_private::Status
Definition: Status.h:44
uint32_t
lldb_private::OptionDefinition::usage_mask
uint32_t usage_mask
Used to mark options that can be used together.
Definition: OptionDefinition.h:23
lldb_private::OptionGroupUInt64::OptionParsingStarting
void OptionParsingStarting(ExecutionContext *execution_context) override
Definition: OptionGroupUInt64.cpp:42
OptionParser.h
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::OptionDefinition::enum_values
OptionEnumValues enum_values
If not empty, an array of enum values.
Definition: OptionDefinition.h:39
lldb_private::OptionDefinition::argument_type
lldb::CommandArgumentType argument_type
Type of argument this option takes.
Definition: OptionDefinition.h:44
lldb_private::OptionDefinition::short_option
int short_option
Single character for this option.
Definition: OptionDefinition.h:32
lldb_private::OptionGroupUInt64::m_option_definition
OptionDefinition m_option_definition
Definition: OptionGroupUInt64.h:43
lldb
Definition: SBAddress.h:15
lldb_private::OptionParser::eRequiredArgument
@ eRequiredArgument
Definition: OptionParser.h:35
lldb_private::OptionValueUInt64::SetValueFromString
Status SetValueFromString(llvm::StringRef value, VarSetOperationType op=eVarSetOperationAssign) override
Definition: OptionValueUInt64.cpp:36