LLDB mainline
Classes | Public Types | Public Member Functions | Public Attributes | List of all members
lldb_private::OptionGroupOptions Class Reference

#include <Options.h>

Inheritance diagram for lldb_private::OptionGroupOptions:
Inheritance graph
[legend]

Classes

struct  OptionInfo
 

Public Types

typedef std::vector< OptionInfoOptionInfos
 

Public Member Functions

 OptionGroupOptions ()=default
 
 ~OptionGroupOptions () override=default
 
void Append (OptionGroup *group)
 Append options from a OptionGroup class.
 
void Append (OptionGroup *group, uint32_t src_mask, uint32_t dst_mask)
 Append options from a OptionGroup class.
 
void Append (OptionGroup *group, llvm::ArrayRef< llvm::StringRef > exclude_long_options)
 Append selected options from a OptionGroup class.
 
void Finalize ()
 
bool DidFinalize ()
 
Status SetOptionValue (uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override
 Set the value of an option.
 
void OptionParsingStarting (ExecutionContext *execution_context) override
 
Status OptionParsingFinished (ExecutionContext *execution_context) override
 
llvm::ArrayRef< OptionDefinitionGetDefinitions () override
 
const OptionGroupGetGroupWithOption (char short_opt)
 
- Public Member Functions inherited from lldb_private::Options
 Options ()
 
virtual ~Options ()
 
void BuildGetoptTable ()
 
void BuildValidOptionSets ()
 
uint32_t NumCommandOptions ()
 
OptionGetLongOptions ()
 Get the option definitions to use when parsing Args options.
 
void OptionSeen (int short_option)
 
bool VerifyOptions (CommandReturnObject &result)
 
bool VerifyPartialOptions (CommandReturnObject &result)
 
void OutputFormattedUsageText (Stream &strm, const OptionDefinition &option_def, uint32_t output_max_columns)
 
void GenerateOptionUsage (Stream &strm, CommandObject &cmd, uint32_t screen_width)
 
bool SupportsLongOption (const char *long_option)
 
virtual llvm::ArrayRef< OptionDefinitionGetDefinitions ()
 
void NotifyOptionParsingStarting (ExecutionContext *execution_context)
 
llvm::Expected< ArgsParse (const Args &args, ExecutionContext *execution_context, lldb::PlatformSP platform_sp, bool require_validation)
 Parse the provided arguments.
 
llvm::Expected< ArgsParseAlias (const Args &args, OptionArgVector *option_arg_vector, std::string &input_line)
 
OptionElementVector ParseForCompletion (const Args &args, uint32_t cursor_index)
 
Status NotifyOptionParsingFinished (ExecutionContext *execution_context)
 
virtual Status SetOptionValue (uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context)=0
 Set the value of an option.
 
bool HandleOptionCompletion (lldb_private::CompletionRequest &request, OptionElementVector &option_map, CommandInterpreter &interpreter)
 Handles the generic bits of figuring out whether we are in an option, and if so completing it.
 
virtual void HandleOptionArgumentCompletion (lldb_private::CompletionRequest &request, OptionElementVector &opt_element_vector, int opt_element_index, CommandInterpreter &interpreter)
 Handles the generic bits of figuring out whether we are in an option, and if so completing it.
 

Public Attributes

std::vector< OptionDefinitionm_option_defs
 
OptionInfos m_option_infos
 
bool m_did_finalize = false
 

Additional Inherited Members

- Protected Types inherited from lldb_private::Options
typedef std::set< int > OptionSet
 
typedef std::vector< OptionSetOptionSetVector
 
- Protected Member Functions inherited from lldb_private::Options
OptionSetVectorGetRequiredOptions ()
 
OptionSetVectorGetOptionalOptions ()
 
bool IsASubset (const OptionSet &set_a, const OptionSet &set_b)
 
size_t OptionsSetDiff (const OptionSet &set_a, const OptionSet &set_b, OptionSet &diffs)
 
void OptionsSetUnion (const OptionSet &set_a, const OptionSet &set_b, OptionSet &union_set)
 
virtual void OptionParsingStarting (ExecutionContext *execution_context)=0
 
virtual Status OptionParsingFinished (ExecutionContext *execution_context)
 
- Protected Attributes inherited from lldb_private::Options
std::vector< Optionm_getopt_table
 
OptionSet m_seen_options
 
OptionSetVector m_required_options
 
OptionSetVector m_optional_options
 

Detailed Description

Definition at line 256 of file Options.h.

Member Typedef Documentation

◆ OptionInfos

Definition at line 332 of file Options.h.

Constructor & Destructor Documentation

◆ OptionGroupOptions()

lldb_private::OptionGroupOptions::OptionGroupOptions ( )
default

◆ ~OptionGroupOptions()

lldb_private::OptionGroupOptions::~OptionGroupOptions ( )
overridedefault

Member Function Documentation

◆ Append() [1/3]

void OptionGroupOptions::Append ( OptionGroup group)

Append options from a OptionGroup class.

Append all options from group using the exact same option groups that each option is defined with.

Parameters
[in]groupA group of options to take option values from and copy their definitions into this class.

Definition at line 755 of file Options.cpp.

References lldb_private::OptionGroup::GetDefinitions(), m_option_defs, and m_option_infos.

Referenced by CommandObjectBreakpointModify::CommandObjectBreakpointModify(), CommandObjectBreakpointNameAdd::CommandObjectBreakpointNameAdd(), CommandObjectBreakpointNameConfigure::CommandObjectBreakpointNameConfigure(), CommandObjectBreakpointNameDelete::CommandObjectBreakpointNameDelete(), CommandObjectBreakpointNameList::CommandObjectBreakpointNameList(), CommandObjectBreakpointSet::CommandObjectBreakpointSet(), CommandObjectCommandsAlias::CommandObjectCommandsAlias(), lldb_private::CommandObjectDWIMPrint::CommandObjectDWIMPrint(), CommandObjectFrameVariable::CommandObjectFrameVariable(), CommandObjectMemoryFind::CommandObjectMemoryFind(), CommandObjectMemoryRead::CommandObjectMemoryRead(), CommandObjectMemoryRegion::CommandObjectMemoryRegion(), CommandObjectMemoryTagWrite::CommandObjectMemoryTagWrite(), CommandObjectPlatformProcessAttach::CommandObjectPlatformProcessAttach(), CommandObjectPlatformProcessLaunch::CommandObjectPlatformProcessLaunch(), CommandObjectPlatformSelect::CommandObjectPlatformSelect(), CommandObjectPlatformSettings::CommandObjectPlatformSettings(), CommandObjectProcessAttach::CommandObjectProcessAttach(), CommandObjectProcessKDPPacketSend::CommandObjectProcessKDPPacketSend(), CommandObjectProcessLaunch::CommandObjectProcessLaunch(), CommandObjectTargetCreate::CommandObjectTargetCreate(), CommandObjectTargetDelete::CommandObjectTargetDelete(), CommandObjectTargetModulesAdd::CommandObjectTargetModulesAdd(), CommandObjectTargetModulesLoad::CommandObjectTargetModulesLoad(), CommandObjectTargetSymbolsAdd::CommandObjectTargetSymbolsAdd(), CommandObjectTargetVariable::CommandObjectTargetVariable(), CommandObjectThreadSelect::CommandObjectThreadSelect(), CommandObjectThreadStepWithTypeAndScope::CommandObjectThreadStepWithTypeAndScope(), CommandObjectPlatformMkDir::GetOptions(), and CommandObjectPlatformFOpen::GetOptions().

◆ Append() [2/3]

void OptionGroupOptions::Append ( OptionGroup group,
llvm::ArrayRef< llvm::StringRef >  exclude_long_options 
)

Append selected options from a OptionGroup class.

Append the subset of options from group, where the "long_option" value is not in exclude_long_options.

Parameters
[in]groupA group of options to take option values from and copy their definitions into this class.
[in]exclude_long_optionsA set of long option strings which indicate which option values values to limit from group.

Definition at line 784 of file Options.cpp.

References lldb_private::OptionGroup::GetDefinitions(), m_option_defs, and m_option_infos.

◆ Append() [3/3]

void OptionGroupOptions::Append ( OptionGroup group,
uint32_t  src_mask,
uint32_t  dst_mask 
)

Append options from a OptionGroup class.

Append options from group that have a usage mask that has any bits in "src_mask" set. After the option definition is copied into the options definitions in this class, set the usage_mask to "dst_mask".

Parameters
[in]groupA group of options to take option values from and copy their definitions into this class.
[in]src_maskWhen copying options from group, you might only want some of the options to be appended to this group. This mask allows you to control which options from group get added. It also allows you to specify the same options from group multiple times for different option sets.
[in]dst_maskSet the usage mask for any copied options to dst_mask after copying the option definition.

Definition at line 772 of file Options.cpp.

References lldb_private::OptionGroup::GetDefinitions(), m_option_defs, and m_option_infos.

◆ DidFinalize()

bool lldb_private::OptionGroupOptions::DidFinalize ( )
inline

◆ Finalize()

void OptionGroupOptions::Finalize ( )

Definition at line 797 of file Options.cpp.

References m_did_finalize.

Referenced by CommandObjectBreakpointModify::CommandObjectBreakpointModify(), CommandObjectBreakpointNameAdd::CommandObjectBreakpointNameAdd(), CommandObjectBreakpointNameConfigure::CommandObjectBreakpointNameConfigure(), CommandObjectBreakpointNameDelete::CommandObjectBreakpointNameDelete(), CommandObjectBreakpointNameList::CommandObjectBreakpointNameList(), CommandObjectBreakpointSet::CommandObjectBreakpointSet(), CommandObjectCommandsAlias::CommandObjectCommandsAlias(), lldb_private::CommandObjectDWIMPrint::CommandObjectDWIMPrint(), CommandObjectFrameVariable::CommandObjectFrameVariable(), CommandObjectMemoryFind::CommandObjectMemoryFind(), CommandObjectMemoryRead::CommandObjectMemoryRead(), CommandObjectMemoryRegion::CommandObjectMemoryRegion(), CommandObjectMemoryTagWrite::CommandObjectMemoryTagWrite(), CommandObjectPlatformProcessAttach::CommandObjectPlatformProcessAttach(), CommandObjectPlatformProcessLaunch::CommandObjectPlatformProcessLaunch(), CommandObjectPlatformSelect::CommandObjectPlatformSelect(), CommandObjectProcessAttach::CommandObjectProcessAttach(), CommandObjectProcessKDPPacketSend::CommandObjectProcessKDPPacketSend(), CommandObjectProcessLaunch::CommandObjectProcessLaunch(), CommandObjectProcessMinidumpDump::CommandObjectProcessMinidumpDump(), CommandObjectTargetCreate::CommandObjectTargetCreate(), CommandObjectTargetDelete::CommandObjectTargetDelete(), CommandObjectTargetModulesAdd::CommandObjectTargetModulesAdd(), CommandObjectTargetModulesLoad::CommandObjectTargetModulesLoad(), CommandObjectTargetSymbolsAdd::CommandObjectTargetSymbolsAdd(), CommandObjectTargetVariable::CommandObjectTargetVariable(), CommandObjectThreadSelect::CommandObjectThreadSelect(), CommandObjectThreadStepWithTypeAndScope::CommandObjectThreadStepWithTypeAndScope(), CommandObjectPlatformConnect::GetOptions(), CommandObjectPlatformSettings::GetOptions(), CommandObjectPlatformMkDir::GetOptions(), and CommandObjectPlatformFOpen::GetOptions().

◆ GetDefinitions()

llvm::ArrayRef< OptionDefinition > lldb_private::OptionGroupOptions::GetDefinitions ( )
inlineoverridevirtual

Reimplemented from lldb_private::Options.

Definition at line 320 of file Options.h.

References m_did_finalize, and m_option_defs.

◆ GetGroupWithOption()

const OptionGroup * OptionGroupOptions::GetGroupWithOption ( char  short_opt)

◆ OptionParsingFinished()

Status OptionGroupOptions::OptionParsingFinished ( ExecutionContext execution_context)
overridevirtual

Reimplemented from lldb_private::Options.

Definition at line 832 of file Options.cpp.

References error(), m_option_infos, and lldb_private::OptionGroup::OptionParsingFinished().

◆ OptionParsingStarting()

void OptionGroupOptions::OptionParsingStarting ( ExecutionContext execution_context)
overridevirtual

◆ SetOptionValue()

Status OptionGroupOptions::SetOptionValue ( uint32_t  option_idx,
llvm::StringRef  option_arg,
ExecutionContext execution_context 
)
overridevirtual

Set the value of an option.

Parameters
[in]option_idxThe index into the "struct option" array that was returned by Options::GetLongOptions().
[in]option_argThe argument value for the option that the user entered, or nullptr if there is no argument for the current option.
[in]execution_contextThe execution context to use for evaluating the option. May be nullptr if the option is to be evaluated outside any particular context.
See also
Args::ParseOptions (Options&)
man getopt_long_only

Implements lldb_private::Options.

Definition at line 801 of file Options.cpp.

References error(), m_did_finalize, and m_option_infos.

Member Data Documentation

◆ m_did_finalize

bool lldb_private::OptionGroupOptions::m_did_finalize = false

◆ m_option_defs

std::vector<OptionDefinition> lldb_private::OptionGroupOptions::m_option_defs

Definition at line 334 of file Options.h.

Referenced by Append(), GetDefinitions(), and GetGroupWithOption().

◆ m_option_infos

OptionInfos lldb_private::OptionGroupOptions::m_option_infos

The documentation for this class was generated from the following files: