LLDB mainline
|
A command line argument class. More...
#include "lldb/Utility/Args.h"
Classes | |
struct | ArgEntry |
Public Types | |
using | const_iterator = std::vector< ArgEntry >::const_iterator |
Public Member Functions | |
Args (llvm::StringRef command=llvm::StringRef()) | |
Construct with an option command string. | |
Args (const Args &rhs) | |
Args (const StringList &list) | |
Args (llvm::ArrayRef< llvm::StringRef > args) | |
Args & | operator= (const Args &rhs) |
~Args () | |
Destructor. | |
Args (const Environment &env) | |
operator Environment () const | |
void | Dump (Stream &s, const char *label_name="argv") const |
Dump all entries to the stream s using label label_name. | |
void | SetCommandString (llvm::StringRef command) |
Sets the command string contained by this object. | |
bool | GetCommandString (std::string &command) const |
bool | GetQuotedCommandString (std::string &command) const |
size_t | GetArgumentCount () const |
Gets the number of arguments left in this command object. | |
bool | empty () const |
const char * | GetArgumentAtIndex (size_t idx) const |
Gets the NULL terminated C string argument pointer for the argument at index idx. | |
llvm::ArrayRef< ArgEntry > | entries () const |
const_iterator | begin () const |
const_iterator | end () const |
size_t | size () const |
const ArgEntry & | operator[] (size_t n) const |
char ** | GetArgumentVector () |
Gets the argument vector. | |
const char ** | GetConstArgumentVector () const |
Gets the argument vector. | |
llvm::ArrayRef< const char * > | GetArgumentArrayRef () const |
Gets the argument as an ArrayRef. | |
void | AppendArgument (llvm::StringRef arg_str, char quote_char='\0') |
Appends a new argument to the end of the list argument list. | |
void | AppendArguments (const Args &rhs) |
void | AppendArguments (const char **argv) |
void | InsertArgumentAtIndex (size_t idx, llvm::StringRef arg_str, char quote_char='\0') |
Insert the argument value at index idx to arg_str. | |
void | ReplaceArgumentAtIndex (size_t idx, llvm::StringRef arg_str, char quote_char='\0') |
Replaces the argument value at index idx to arg_str if idx is a valid argument index. | |
void | DeleteArgumentAtIndex (size_t idx) |
Deletes the argument value at index if idx is a valid argument index. | |
void | SetArguments (size_t argc, const char **argv) |
Sets the argument vector value, optionally copying all arguments into an internal buffer. | |
void | SetArguments (const char **argv) |
void | Shift () |
Shifts the first argument C string value of the array off the argument array. | |
void | Unshift (llvm::StringRef arg_str, char quote_char='\0') |
Inserts a class owned copy of arg_str at the beginning of the argument vector. | |
void | Clear () |
Clear the arguments. | |
Static Public Member Functions | |
static lldb::Encoding | StringToEncoding (llvm::StringRef s, lldb::Encoding fail_value=lldb::eEncodingInvalid) |
static uint32_t | StringToGenericRegister (llvm::StringRef s) |
static std::string | GetShellSafeArgument (const FileSpec &shell, llvm::StringRef unsafe_arg) |
static void | EncodeEscapeSequences (const char *src, std::string &dst) |
EncodeEscapeSequences will change the textual representation of common escape sequences like "\n" (two characters) into a single ' '. | |
static void | ExpandEscapedCharacters (const char *src, std::string &dst) |
ExpandEscapeSequences will change a string of possibly non-printable characters and expand them into text. | |
static std::string | EscapeLLDBCommandArgument (const std::string &arg, char quote_char) |
Private Attributes | |
std::vector< ArgEntry > | m_entries |
std::vector< char * > | m_argv |
The arguments as C strings with a trailing nullptr element. | |
A command line argument class.
The Args class is designed to be fed a command line. The command line is copied into an internal buffer and then split up into arguments. Arguments are space delimited if there are no quotes (single, double, or backtick quotes) surrounding the argument. Spaces can be escaped using a \ character to avoid having to surround an argument that contains a space with quotes.
using lldb_private::Args::const_iterator = std::vector<ArgEntry>::const_iterator |
Args::Args | ( | llvm::StringRef | command = llvm::StringRef() | ) |
Construct with an option command string.
[in] | command | A NULL terminated command that will be copied and split up into arguments. |
Definition at line 168 of file Args.cpp.
References SetCommandString().
|
explicit |
Definition at line 172 of file Args.cpp.
References AppendArgument().
|
explicit |
Definition at line 177 of file Args.cpp.
References AppendArgument().
|
default |
Destructor.
|
inlineexplicit |
Definition at line 74 of file Args.h.
References lldb_private::Environment::Envp::get(), lldb_private::Environment::getEnvp(), and SetArguments().
void Args::AppendArgument | ( | llvm::StringRef | arg_str, |
char | quote_char = '\0' |
||
) |
Appends a new argument to the end of the list argument list.
[in] | arg_str | The new argument. |
[in] | quote_char | If the argument was originally quoted, put in the quote char here. |
Definition at line 322 of file Args.cpp.
References GetArgumentCount(), and InsertArgumentAtIndex().
Referenced by lldb_private::CompletionRequest::AppendEmptyArgument(), Args(), lldb_private::CommandInterpreter::BuildAliasCommandArgs(), lldb::SBPlatform::ConnectRemote(), lldb_private::ProcessLaunchInfo::ConvertArgumentsForLaunchingInShell(), lldb_private::PlatformQemuUser::DebugProcess(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::DecodeProcessInfoResponse(), CommandObjectPlatformProcessLaunch::DoExecute(), CommandObjectProcessLaunch::DoExecute(), lldb_private::BreakpointIDList::FindAndReplaceIDRanges(), lldb_private::OptionValueArgs::GetArgs(), lldb_private::OptionValueArray::GetArgs(), lldb_private::OptionValueDictionary::GetArgs(), lldb_private::PlatformDarwin::GetExtraStartupCommands(), GetFreeBSDProcessArgs(), GetMacOSXProcessArgs(), GetNetBSDProcessArgs(), GetOpenBSDProcessArgs(), GetProcessArgs(), CommandObjectThreadBacktrace::GetRepeatCommand(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_A(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_vRun(), ReconstituteArgsAfterParsing(), CommandObjectProcessContinue::CommandOptions::SetOptionValue(), CommandObjectBreakpointSet::CommandOptions::SetOptionValue(), lldb_private::process_gdb_remote::GDBRemoteCommunication::StartDebugserverProcess(), and xcrun().
void Args::AppendArguments | ( | const Args & | rhs | ) |
Definition at line 297 of file Args.cpp.
References m_argv, and m_entries.
Referenced by CommandObjectPlatformProcessLaunch::DoExecute(), CommandObjectProcessLaunch::DoExecute(), lldb_private::CommandObjectParsed::Execute(), lldb::SBTarget::Launch(), lldb::SBProcess::RemoteLaunch(), lldb_private::Host::RunShellCommand(), and lldb_private::process_gdb_remote::GDBRemoteCommunication::StartDebugserverProcess().
void Args::AppendArguments | ( | const char ** | argv | ) |
Definition at line 308 of file Args.cpp.
References ArgvToArgc(), m_argv, and m_entries.
|
inline |
void Args::Clear | ( | ) |
Clear the arguments.
For re-setting or blanking out the list of arguments.
Definition at line 378 of file Args.cpp.
References m_argv, and m_entries.
Referenced by lldb_private::CommandInterpreter::BuildAliasCommandArgs(), lldb_private::ProcessInfo::Clear(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::DecodeProcessInfoResponse(), lldb_private::BreakpointIDList::FindAndReplaceIDRanges(), lldb_private::OptionValueArgs::GetArgs(), lldb_private::OptionValueArray::GetArgs(), lldb_private::OptionValueDictionary::GetArgs(), operator=(), CommandObjectBreakpointSet::CommandOptions::OptionParsingStarting(), CommandObjectProcessContinue::CommandOptions::OptionParsingStarting(), SetArguments(), SetCommandString(), and lldb_private::process_gdb_remote::GDBRemoteCommunication::StartDebugserverProcess().
void Args::DeleteArgumentAtIndex | ( | size_t | idx | ) |
Deletes the argument value at index if idx is a valid argument index.
[in] | idx | The index of the argument that will have its value replaced. |
Definition at line 349 of file Args.cpp.
References m_argv, and m_entries.
Referenced by lldb_private::CommandCompletions::CompleteModifiableCmdPathArgs(), and lldb_private::Options::ParseAlias().
void Args::Dump | ( | Stream & | s, |
const char * | label_name = "argv" |
||
) | const |
Dump all entries to the stream s using label label_name.
If label_name is nullptr, the dump operation is skipped.
[in] | s | The stream to which to dump all arguments in the argument vector. |
[in] | label_name | The label_name to use as the label printed for each entry of the args like so: {label_name}[{index}]={value} |
Definition at line 198 of file Args.cpp.
References lldb_private::Stream::EOL(), lldb_private::Stream::Format(), lldb_private::Stream::Indent(), and m_entries.
Referenced by lldb_private::ProcessInfo::Dump().
|
inline |
Definition at line 118 of file Args.h.
References GetArgumentCount().
Referenced by CommandObjectCommandsUnalias::DoExecute(), CommandObjectCommandsDelete::DoExecute(), CommandObjectLogDisable::DoExecute(), CommandObjectLogList::DoExecute(), CommandObjectLogDump::DoExecute(), CommandObjectSessionSave::DoExecute(), CommandObjectSettingsShow::DoExecute(), CommandObjectSettingsWrite::DoExecute(), CommandObjectBreakpointEnable::DoExecute(), CommandObjectBreakpointList::DoExecute(), CommandObjectBreakpointDelete::DoExecute(), CommandObjectBreakpointNameList::DoExecute(), CommandObjectBreakpointWrite::DoExecute(), CommandObjectBreakpointCommandDelete::DoExecute(), CommandObjectBreakpointCommandList::DoExecute(), CommandObjectCommandsScriptImport::DoExecute(), lldb_private::CommandObjectDisassemble::DoExecute(), CommandObjectFrameVariable::DoExecute(), CommandObjectTraceSchema::DoExecute(), CommandObjectWatchpointDelete::DoExecute(), GetFlattenedWindowsCommandString(), lldb_private::Editline::TabCommand(), lldb_private::CommandObjectMultiwordBreakpoint::VerifyIDs(), and WarnOnPotentialUnquotedUnsignedType().
|
static |
EncodeEscapeSequences will change the textual representation of common escape sequences like "\n" (two characters) into a single '
'.
It does this for all of the supported escaped sequences and for the \0ooo (octal) and \xXX (hex). The resulting "dst" string will contain the character versions of all supported escape sequences. The common supported escape sequences are: "\a", "\b", "\f", "\n", "\r", "\t", "\v", "\'", "\"", "\\".
Definition at line 453 of file Args.cpp.
Referenced by lldb_private::OptionValueString::SetValueFromString().
|
inline |
Definition at line 133 of file Args.h.
References m_entries.
Referenced by CommandObjectSourceList::GetRepeatCommand(), and ReconstituteArgsAfterParsing().
|
inline |
Definition at line 128 of file Args.h.
References m_entries.
Referenced by lldb_private::CommandInterpreter::BuildAliasCommandArgs(), CommandObjectLogList::DoExecute(), CommandObjectPlatformProcessInfo::DoExecute(), CommandObjectTargetDelete::DoExecute(), CommandObjectTargetModulesAdd::DoExecute(), CommandObjectTargetSymbolsAdd::DoExecute(), CommandObjectBreakpointNameConfigure::DoExecute(), CommandObjectCommandsScriptImport::DoExecute(), lldb_private::CommandObjectHelp::DoExecute(), CommandObjectProcessLoad::DoExecute(), CommandObjectProcessUnload::DoExecute(), CommandObjectTargetModulesDumpClangAST::DoExecute(), CommandObjectThreadContinue::DoExecute(), CommandObjectMultiwordItaniumABI_Demangle::DoExecute(), lldb_private::CommandObjectParsed::Execute(), CommandObjectTypeSummaryAdd::Execute_StringSummary(), GetFlattenedWindowsCommandString(), ProcessAliasOptionsArgs(), lldb_private::CommandObjectMultiwordWatchpoint::VerifyWatchpointIDs(), and WarnOnPotentialUnquotedUnsignedType().
|
static |
Definition at line 603 of file Args.cpp.
Referenced by lldb::SBCommandInterpreter::HandleCompletionWithDescriptions().
|
static |
ExpandEscapeSequences will change a string of possibly non-printable characters and expand them into text.
So '
' will turn into two characters like "\n" which is suitable for human reading. When a character is not printable and isn't one of the common in escape sequences listed in the help for EncodeEscapeSequences, then it will be encoded as octal. Printable characters are left alone.
Definition at line 552 of file Args.cpp.
Referenced by lldb_private::OptionValueString::DumpValue().
|
inline |
Gets the argument as an ArrayRef.
Note that the return value does not have a nullptr const char * at the end, as the size of the list is embedded in the ArrayRef object.
Definition at line 169 of file Args.h.
References m_argv.
Referenced by CommandObjectLogEnable::DoExecute(), CommandObjectLogDisable::DoExecute(), get_arg_range(), and lldb_private::CommandObjectMultiwordBreakpoint::VerifyIDs().
const char * Args::GetArgumentAtIndex | ( | size_t | idx | ) | const |
Gets the NULL terminated C string argument pointer for the argument at index idx.
Definition at line 263 of file Args.cpp.
References m_argv.
Referenced by lldb_private::CommandInterpreter::BuildAliasCommandArgs(), lldb_private::CommandInterpreter::BuildAliasResult(), CommandObjectTypeFilterDelete::CommandObjectTypeFilterDelete(), CompleteEnableDisable(), lldb_private::CommandCompletions::CompleteModifiableCmdPathArgs(), lldb_private::platform_android::PlatformAndroid::ConnectRemote(), lldb_private::platform_android::PlatformAndroidRemoteGDBServer::ConnectRemote(), lldb_private::platform_gdb_server::PlatformRemoteGDBServer::ConnectRemote(), lldb_private::PlatformAppleSimulator::ConnectRemote(), CommandObjectPlatformSelect::DoExecute(), CommandObjectPlatformInstall::DoExecute(), lldb_private::CommandObjectQuit::DoExecute(), CommandObjectTargetSelect::DoExecute(), CommandObjectTargetModulesLoad::DoExecute(), CommandObjectThreadPlanDiscard::DoExecute(), CommandObjectThreadPlanPrune::DoExecute(), CommandObjectCommandsContainerAdd::DoExecute(), CommandObjectCommandsContainerDelete::DoExecute(), CommandObjectFrameRecognizerDelete::DoExecute(), CommandObjectFrameRecognizerInfo::DoExecute(), CommandObjectProcessConnect::DoExecute(), CommandObjectProcessSignal::DoExecute(), CommandObjectProcessSaveCore::DoExecute(), CommandObjectSettingsClear::DoExecute(), CommandObjectTargetCreate::DoExecute(), CommandObjectTargetModulesSearchPathsAdd::DoExecute(), CommandObjectTargetModulesSearchPathsInsert::DoExecute(), CommandObjectTargetModulesSearchPathsQuery::DoExecute(), CommandObjectTargetModulesDumpObjfile::DoExecute(), CommandObjectTargetModulesDumpSymtab::DoExecute(), CommandObjectTargetModulesDumpSections::DoExecute(), CommandObjectTargetModulesDumpClangPCMInfo::DoExecute(), CommandObjectTargetModulesDumpSymfile::DoExecute(), CommandObjectTargetModulesDumpLineTable::DoExecute(), CommandObjectTargetModulesDumpSeparateDebugInfoFiles::DoExecute(), CommandObjectTargetModulesShowUnwind::DoExecute(), CommandObjectTargetModulesLookup::DoExecute(), CommandObjectTargetStopHookDelete::DoExecute(), CommandObjectTargetStopHookEnableDisable::DoExecute(), CommandObjectThreadStepWithTypeAndScope::DoExecute(), CommandObjectThreadUntil::DoExecute(), CommandObjectThreadSelect::DoExecute(), lldb_private::CommandObjectIterateOverThreads::DoExecute(), lldb_private::CommandObjectMultipleThreads::DoExecute(), CommandObjectTypeFormatterDelete::DoExecute(), CommandObjectTypeFormatterClear::DoExecute(), CommandObjectTypeFormatterList< FormatterType >::DoExecute(), CommandObjectObjC_ClassTable_Dump::DoExecute(), CommandObjectMultiwordObjC_TaggedPointer_Info::DoExecute(), CommandObjectProcessGDBRemotePacketXferSize::DoExecute(), CommandObjectProcessGDBRemotePacketSend::DoExecute(), CommandObjectSettingsRemove::DoExecute(), CommandObjectSettingsReplace::DoExecute(), CommandObjectSettingsInsertBefore::DoExecute(), CommandObjectSettingsInsertAfter::DoExecute(), CommandObjectSettingsAppend::DoExecute(), lldb_private::process_gdb_remote::ProcessGDBRemote::DoLaunch(), lldb_private::ProcessInstanceInfo::Dump(), lldb_private::ProcessInstanceInfo::DumpAsTableRow(), lldb_private::CommandInterpreter::GetCommandSPExact(), lldb_private::CompletionRequest::GetCursorArgumentPrefix(), GetSingleThreadFromArgs(), lldb_private::CommandInterpreter::HandleCompletion(), lldb_private::CommandInterpreter::HandleCompletionMatches(), CommandObjectBreakpointRead::CommandOptions::HandleOptionArgumentCompletion(), lldb_private::Options::HandleOptionArgumentCompletion(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerPlatform::LaunchProcess(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::LaunchProcess(), lldb_private::platform_gdb_server::PlatformRemoteGDBServer::LaunchProcess(), sddarwinlog_private::ParseAutoEnableOptions(), lldb_private::Target::PrintDummySignals(), CommandObjectProcessHandle::PrintSignalInformation(), lldb_private::OptionValueArray::SetArgs(), lldb_private::ProcessInfo::SetArguments(), lldb_private::OptionValueFileSpecList::SetValueFromString(), lldb_private::OptionValuePathMappings::SetValueFromString(), CoreSimulatorSupport::Device::Spawn(), lldb_private::UnwindLLDB::UnwindLLDB(), and lldb_private::CommandInterpreter::VerifyUserMultiwordCmdPath().
|
inline |
Gets the number of arguments left in this command object.
Definition at line 116 of file Args.h.
References m_entries.
Referenced by AppendArgument(), lldb_private::CommandInterpreter::BuildAliasCommandArgs(), lldb_private::CommandInterpreter::BuildAliasResult(), lldb_private::Target::ClearDummySignals(), lldb_private::CommandCompletions::CompleteModifiableCmdPathArgs(), lldb_private::CompletionRequest::CompletionRequest(), lldb_private::ObjCLanguageRuntime::ObjCExceptionPrecondition::ConfigurePrecondition(), lldb_private::platform_android::PlatformAndroidRemoteGDBServer::ConnectRemote(), lldb_private::platform_gdb_server::PlatformRemoteGDBServer::ConnectRemote(), lldb_private::PlatformAppleSimulator::ConnectRemote(), CommandObjectLogEnable::DoExecute(), CommandObjectLogTimerEnable::DoExecute(), CommandObjectLogTimerIncrement::DoExecute(), CommandObjectPlatformSelect::DoExecute(), CommandObjectPlatformDisconnect::DoExecute(), CommandObjectPlatformProcessLaunch::DoExecute(), CommandObjectPlatformProcessInfo::DoExecute(), CommandObjectPlatformInstall::DoExecute(), lldb_private::CommandObjectQuit::DoExecute(), CommandObjectSettingsList::DoExecute(), CommandObjectTargetSelect::DoExecute(), CommandObjectTargetDelete::DoExecute(), CommandObjectTargetVariable::DoExecute(), CommandObjectTargetModulesAdd::DoExecute(), CommandObjectTargetModulesLoad::DoExecute(), CommandObjectTargetSymbolsAdd::DoExecute(), CommandObjectThreadPlanDiscard::DoExecute(), CommandObjectThreadPlanPrune::DoExecute(), lldb_private::CommandObjectApropos::DoExecute(), CommandObjectBreakpointNameConfigure::DoExecute(), CommandObjectCommandsSource::DoExecute(), CommandObjectCommandsScriptAdd::DoExecute(), CommandObjectCommandsScriptDelete::DoExecute(), CommandObjectCommandsContainerAdd::DoExecute(), CommandObjectCommandsContainerDelete::DoExecute(), CommandObjectFrameSelect::DoExecute(), CommandObjectFrameRecognizerDelete::DoExecute(), CommandObjectFrameRecognizerInfo::DoExecute(), lldb_private::CommandObjectHelp::DoExecute(), CommandObjectMemoryRead::DoExecute(), CommandObjectMemoryFind::DoExecute(), CommandObjectMemoryWrite::DoExecute(), CommandObjectMemoryHistory::DoExecute(), CommandObjectMemoryRegion::DoExecute(), CommandObjectMemoryTagRead::DoExecute(), CommandObjectMemoryTagWrite::DoExecute(), CommandObjectPluginLoad::DoExecute(), CommandObjectProcessContinue::DoExecute(), CommandObjectProcessConnect::DoExecute(), CommandObjectProcessSignal::DoExecute(), CommandObjectProcessSaveCore::DoExecute(), CommandObjectRegisterRead::DoExecute(), CommandObjectRegisterWrite::DoExecute(), CommandObjectRegisterInfo::DoExecute(), CommandObjectSettingsClear::DoExecute(), CommandObjectTargetCreate::DoExecute(), CommandObjectTargetModulesSearchPathsAdd::DoExecute(), CommandObjectTargetModulesSearchPathsInsert::DoExecute(), CommandObjectTargetModulesSearchPathsQuery::DoExecute(), CommandObjectTargetModulesDumpObjfile::DoExecute(), CommandObjectTargetModulesDumpSymtab::DoExecute(), CommandObjectTargetModulesDumpSections::DoExecute(), CommandObjectTargetModulesDumpClangPCMInfo::DoExecute(), CommandObjectTargetModulesDumpClangAST::DoExecute(), CommandObjectTargetModulesDumpSymfile::DoExecute(), CommandObjectTargetModulesDumpLineTable::DoExecute(), CommandObjectTargetModulesDumpSeparateDebugInfoFiles::DoExecute(), CommandObjectTargetModulesList::DoExecute(), CommandObjectTargetModulesShowUnwind::DoExecute(), CommandObjectTargetModulesLookup::DoExecute(), CommandObjectTargetStopHookDelete::DoExecute(), CommandObjectTargetStopHookEnableDisable::DoExecute(), CommandObjectThreadStepWithTypeAndScope::DoExecute(), CommandObjectThreadContinue::DoExecute(), CommandObjectThreadUntil::DoExecute(), CommandObjectThreadSelect::DoExecute(), CommandObjectThreadPlanList::DoExecute(), lldb_private::CommandObjectIterateOverThreads::DoExecute(), lldb_private::CommandObjectMultipleThreads::DoExecute(), CommandObjectTypeFormatterDelete::DoExecute(), CommandObjectTypeFormatterClear::DoExecute(), CommandObjectTypeFormatterList< FormatterType >::DoExecute(), CommandObjectWatchpointList::DoExecute(), CommandObjectWatchpointEnable::DoExecute(), CommandObjectWatchpointDisable::DoExecute(), CommandObjectWatchpointIgnore::DoExecute(), CommandObjectWatchpointModify::DoExecute(), CommandObjectWatchpointCommandDelete::DoExecute(), CommandObjectWatchpointCommandList::DoExecute(), CommandObjectObjC_ClassTable_Dump::DoExecute(), CommandObjectMultiwordObjC_TaggedPointer_Info::DoExecute(), CommandObjectProcessGDBRemoteSpeedTest::DoExecute(), CommandObjectProcessGDBRemotePacketXferSize::DoExecute(), CommandObjectProcessGDBRemotePacketSend::DoExecute(), CommandObjectProcessMinidumpDump::DoExecute(), CommandObjectProcessLaunch::DoExecute(), CommandObjectProcessHandle::DoExecute(), CommandObjectSettingsRemove::DoExecute(), CommandObjectSettingsInsertBefore::DoExecute(), CommandObjectSettingsInsertAfter::DoExecute(), CommandObjectSettingsAppend::DoExecute(), lldb_private::ProcessInstanceInfo::Dump(), lldb_private::ProcessInstanceInfo::DumpAsTableRow(), empty(), lldb_private::CommandObjectParsed::Execute(), lldb_private::CommandObjectMultiword::Execute(), CommandObjectTypeSummaryAdd::Execute_StringSummary(), lldb_private::OptionValueArgs::GetArgs(), lldb_private::OptionValueArray::GetArgs(), lldb_private::OptionValueDictionary::GetArgs(), lldb_private::CommandInterpreter::GetCommandSPExact(), CommandObjectTypeCategoryEnable::CommandOptions::GetDefinitions(), CommandObjectThreadBacktrace::GetRepeatCommand(), lldb_private::CommandObjectMultiword::GetRepeatCommand(), GetSingleThreadFromArgs(), lldb_private::CommandObjectMultiword::HandleCompletion(), lldb_private::CommandInterpreter::HandleCompletionMatches(), lldb::SBCommandInterpreter::HandleCompletionWithDescriptions(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::LaunchProcess(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerPlatform::LaunchProcess(), CommandObjectTypeCategoryDisable::CommandOptions::OptionParsingStarting(), lldb_private::Options::ParseAlias(), sddarwinlog_private::ParseAutoEnableOptions(), lldb_private::Target::PrintDummySignals(), CommandObjectProcessHandle::PrintSignalInformation(), lldb_private::OptionValueArray::SetArgs(), lldb_private::OptionValueDictionary::SetArgs(), lldb_private::OptionValueFileSpecList::SetValueFromString(), lldb_private::OptionValuePathMappings::SetValueFromString(), size(), CoreSimulatorSupport::Device::Spawn(), lldb_private::process_gdb_remote::GDBRemoteCommunication::StartDebugserverProcess(), lldb_private::UnwindLLDB::UnwindLLDB(), lldb_private::CommandInterpreter::VerifyUserMultiwordCmdPath(), and lldb_private::CommandObjectMultiwordWatchpoint::VerifyWatchpointIDs().
char ** Args::GetArgumentVector | ( | ) |
Gets the argument vector.
The value returned by this function can be used by any function that takes and vector. The return value is just like argv in the standard C entry point function:
Definition at line 269 of file Args.cpp.
References m_argv.
Referenced by lldb_private::CommandPluginInterfaceImplementation::DoExecute().
bool Args::GetCommandString | ( | std::string & | command | ) | const |
Definition at line 211 of file Args.cpp.
References m_entries.
Referenced by CommandObjectPlatformMkDir::DoExecute(), CommandObjectPlatformFOpen::DoExecute(), CommandObjectPlatformFClose::DoExecute(), CommandObjectPlatformFRead::DoExecute(), CommandObjectPlatformFWrite::DoExecute(), lldb_private::CommandObjectHelp::DoExecute(), CommandObjectTraceDumpInstructions::GetRepeatCommand(), and xcrun().
const char ** Args::GetConstArgumentVector | ( | ) | const |
Gets the argument vector.
The value returned by this function can be used by any function that takes and vector. The return value is just like argv in the standard C entry point function:
Definition at line 279 of file Args.cpp.
References m_argv.
Referenced by lldb_private::CommandInterpreter::BuildAliasCommandArgs(), lldb_private::ProcessLaunchInfo::ConvertArgumentsForLaunchingInShell(), lldb_private::CommandObjectParsed::Execute(), LaunchProcessPosixSpawn(), MaybeLogLaunchInfo(), and operator Environment().
bool Args::GetQuotedCommandString | ( | std::string & | command | ) | const |
Definition at line 228 of file Args.cpp.
References m_entries.
Referenced by CommandObjectThreadBacktrace::GetRepeatCommand().
|
static |
Definition at line 384 of file Args.cpp.
References lldb_private::FileSpec::GetFilename(), and lldb_private::ConstString::GetStringRef().
Referenced by lldb_private::ProcessLaunchInfo::ConvertArgumentsForLaunchingInShell().
void Args::InsertArgumentAtIndex | ( | size_t | idx, |
llvm::StringRef | arg_str, | ||
char | quote_char = '\0' |
||
) |
Insert the argument value at index idx to arg_str.
[in] | idx | The index of where to insert the argument. |
[in] | arg_str | The new argument. |
[in] | quote_char | If the argument was originally quoted, put in the quote char here. |
Definition at line 326 of file Args.cpp.
References m_argv, and m_entries.
Referenced by AppendArgument(), lldb_private::ProcessInfo::SetExecutableFile(), and Unshift().
|
inlineexplicit |
Definition at line 78 of file Args.h.
References GetConstArgumentVector().
|
inline |
void Args::ReplaceArgumentAtIndex | ( | size_t | idx, |
llvm::StringRef | arg_str, | ||
char | quote_char = '\0' |
||
) |
Replaces the argument value at index idx to arg_str if idx is a valid argument index.
[in] | idx | The index of the argument that will have its value replaced. |
[in] | arg_str | The new argument. |
[in] | quote_char | If the argument was originally quoted, put in the quote char here. |
Definition at line 337 of file Args.cpp.
References m_argv, and m_entries.
Referenced by lldb_private::platform_android::PlatformAndroidRemoteGDBServer::ConnectRemote(), lldb_private::process_gdb_remote::ProcessGDBRemote::DoLaunch(), lldb_private::CommandObjectParsed::Execute(), CommandObjectThreadBacktrace::GetRepeatCommand(), and lldb_private::platform_gdb_server::PlatformRemoteGDBServer::LaunchProcess().
void Args::SetArguments | ( | const char ** | argv | ) |
Definition at line 374 of file Args.cpp.
References ArgvToArgc(), and SetArguments().
void Args::SetArguments | ( | size_t | argc, |
const char ** | argv | ||
) |
Sets the argument vector value, optionally copying all arguments into an internal buffer.
Sets the arguments to match those found in argv. All argument strings will be copied into an internal buffers.
Definition at line 357 of file Args.cpp.
References Clear(), m_argv, and m_entries.
Referenced by Args(), lldb_private::CommandInterpreter::BuildAliasCommandArgs(), lldb_private::ProcessInfo::SetArguments(), and SetArguments().
void Args::SetCommandString | ( | llvm::StringRef | command | ) |
Sets the command string contained by this object.
The command string will be copied and split up into arguments that can be accessed via the accessor functions.
[in] | command | A command StringRef that will be copied and split up into arguments. |
Definition at line 247 of file Args.cpp.
References Clear(), ltrimForArgs(), m_argv, m_entries, and ParseSingleArgument().
Referenced by Args().
void Args::Shift | ( | ) |
Shifts the first argument C string value of the array off the argument array.
The string value will be freed, so a copy of the string should be made by calling Args::GetArgumentAtIndex (size_t) const first and copying the returned value before calling Args::Shift().
Definition at line 285 of file Args.cpp.
References m_argv, and m_entries.
Referenced by lldb_private::CommandInterpreter::BuildAliasCommandArgs(), CommandObjectLogEnable::DoExecute(), CommandObjectLogDisable::DoExecute(), CommandObjectMemoryWrite::DoExecute(), CommandObjectMemoryTagWrite::DoExecute(), CommandObjectTargetModulesSearchPathsInsert::DoExecute(), lldb_private::CommandObjectMultiword::Execute(), lldb_private::CommandObjectMultiword::HandleCompletion(), sddarwinlog_private::ParseAutoEnableOptions(), and lldb_private::CompletionRequest::ShiftArguments().
|
inline |
Definition at line 135 of file Args.h.
References GetArgumentCount().
Referenced by lldb_private::Args::ArgEntry::ArgEntry(), CommandObjectTraceSave::DoExecute(), CommandObjectTraceLoad::DoExecute(), lldb_private::BreakpointIDList::FindAndReplaceIDRanges(), and lldb_private::Editline::TabCommand().
|
static |
Definition at line 421 of file Args.cpp.
References lldb::eEncodingIEEE754, lldb::eEncodingSint, lldb::eEncodingUint, and lldb::eEncodingVector.
Referenced by lldb_private::process_gdb_remote::ProcessGDBRemote::BuildDynamicRegisterInfo(), and lldb_private::DynamicRegisterInfo::SetRegisterInfo().
|
static |
Definition at line 431 of file Args.cpp.
References LLDB_INVALID_REGNUM, LLDB_REGNUM_GENERIC_ARG1, LLDB_REGNUM_GENERIC_ARG2, LLDB_REGNUM_GENERIC_ARG3, LLDB_REGNUM_GENERIC_ARG4, LLDB_REGNUM_GENERIC_ARG5, LLDB_REGNUM_GENERIC_ARG6, LLDB_REGNUM_GENERIC_ARG7, LLDB_REGNUM_GENERIC_ARG8, LLDB_REGNUM_GENERIC_FLAGS, LLDB_REGNUM_GENERIC_FP, LLDB_REGNUM_GENERIC_PC, LLDB_REGNUM_GENERIC_RA, LLDB_REGNUM_GENERIC_SP, and LLDB_REGNUM_GENERIC_TP.
Referenced by lldb_private::process_gdb_remote::ProcessGDBRemote::BuildDynamicRegisterInfo(), lldb_private::NativeRegisterContext::GetRegisterInfoByName(), lldb_private::RegisterContext::GetRegisterInfoByName(), and lldb_private::DynamicRegisterInfo::SetRegisterInfo().
void Args::Unshift | ( | llvm::StringRef | arg_str, |
char | quote_char = '\0' |
||
) |
Inserts a class owned copy of arg_str at the beginning of the argument vector.
A copy arg_str will be made.
[in] | arg_str | The argument to push on the front of the argument stack. |
[in] | quote_char | If the argument was originally quoted, put in the quote char here. |
Definition at line 293 of file Args.cpp.
References InsertArgumentAtIndex().
Referenced by lldb_private::CommandInterpreter::BuildAliasCommandArgs(), and lldb_private::CommandInterpreter::BuildAliasResult().
|
private |
The arguments as C strings with a trailing nullptr element.
These strings are owned by the ArgEntry object in m_entries with the same index.
Definition at line 293 of file Args.h.
Referenced by AppendArguments(), Clear(), DeleteArgumentAtIndex(), GetArgumentArrayRef(), GetArgumentAtIndex(), GetArgumentVector(), GetConstArgumentVector(), InsertArgumentAtIndex(), operator=(), ReplaceArgumentAtIndex(), SetArguments(), SetCommandString(), and Shift().
|
private |
Definition at line 288 of file Args.h.
Referenced by AppendArguments(), begin(), Clear(), DeleteArgumentAtIndex(), Dump(), end(), entries(), GetArgumentCount(), GetCommandString(), GetQuotedCommandString(), InsertArgumentAtIndex(), operator=(), operator[](), ReplaceArgumentAtIndex(), SetArguments(), SetCommandString(), and Shift().