28 Stream &strm, uint32_t dump_mask) {
53 Args args(value.str());
65 if (argc >= 3 && (((argc - 1) & 1) == 0)) {
70 "invalid file list index %s, index must be 0 through %u",
74 for (
size_t i = 1; i < argc; idx++, i += 2) {
84 std::string previousError =
85 error.Fail() ? std::string(
error.AsCString()) +
"\n" :
"";
87 "%sthe replacement path doesn't exist: \"%s\"",
88 previousError.c_str(), replace_path);
96 "replace operation takes an array index followed by "
97 "one or more path pairs");
102 if (argc < 2 || (argc & 1)) {
104 "assign operation takes one or more path pairs");
111 if (argc < 2 || (argc & 1)) {
113 "append operation takes one or more path pairs");
116 bool changed =
false;
117 for (
size_t i = 0; i < argc; i += 2) {
125 std::string previousError =
126 error.Fail() ? std::string(
error.AsCString()) +
"\n" :
"";
128 "%sthe replacement path doesn't exist: \"%s\"",
129 previousError.c_str(), replace_path);
141 if (argc >= 3 && (((argc - 1) & 1) == 0)) {
146 "invalid file list index %s, index must be 0 through %u",
149 bool changed =
false;
152 for (
size_t i = 1; i < argc; i += 2) {
161 std::string previousError =
162 error.Fail() ? std::string(
error.AsCString()) +
"\n" :
"";
164 "%sthe replacement path doesn't exist: \"%s\"",
165 previousError.c_str(), replace_path);
173 "insert operation takes an array index followed by "
174 "one or more path pairs");
180 std::vector<int> remove_indexes;
181 for (
size_t i = 0; i < argc; ++i) {
186 "invalid array index '%s', aborting remove operation",
190 remove_indexes.push_back(idx);
194 llvm::sort(remove_indexes);
195 for (
auto index : llvm::reverse(remove_indexes))
200 "remove operation takes one or more array index");
static llvm::raw_ostream & error(Stream &strm)
static bool VerifyPathExists(const char *path)
A command line argument class.
size_t GetArgumentCount() const
Gets the number of arguments left in this command object.
const char * GetArgumentAtIndex(size_t idx) const
Gets the NULL terminated C string argument pointer for the argument at index idx.
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
bool Exists(const FileSpec &file_spec) const
Returns whether the given file exists.
static FileSystem & Instance()
PathMappingList m_path_mappings
Status SetValueFromString(llvm::StringRef value, VarSetOperationType op=eVarSetOperationAssign) override
void DumpValue(const ExecutionContext *exe_ctx, Stream &strm, uint32_t dump_mask) override
llvm::json::Value ToJSON(const ExecutionContext *exe_ctx) const override
virtual Status SetValueFromString(llvm::StringRef value, VarSetOperationType op=eVarSetOperationAssign)
void NotifyValueChanged()
virtual const char * GetTypeAsCString() const
@ eDumpOptionDefaultValue
static Status FromErrorStringWithFormat(const char *format,...) __attribute__((format(printf
static Status FromErrorString(const char *str)
A stream class that can stream formatted output to a file.
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
size_t PutCString(llvm::StringRef cstr)
Output a C string to the stream.
A class that represents a running process on the host machine.
VarSetOperationType
Settable state variable types.
@ eVarSetOperationReplace
@ eVarSetOperationInvalid
@ eVarSetOperationInsertBefore
@ eVarSetOperationInsertAfter