27 Stream &strm, uint32_t dump_mask) {
45 Args args(value.str());
57 if (argc >= 3 && (((argc - 1) & 1) == 0)) {
62 "invalid file list index %s, index must be 0 through %u",
66 for (
size_t i = 1; i < argc; idx++, i += 2) {
76 std::string previousError =
77 error.Fail() ? std::string(
error.AsCString()) +
"\n" :
"";
79 "%sthe replacement path doesn't exist: \"%s\"",
80 previousError.c_str(), replace_path);
88 "replace operation takes an array index followed by "
89 "one or more path pairs");
94 if (argc < 2 || (argc & 1)) {
96 "assign operation takes one or more path pairs");
103 if (argc < 2 || (argc & 1)) {
105 "append operation takes one or more path pairs");
108 bool changed =
false;
109 for (
size_t i = 0; i < argc; i += 2) {
117 std::string previousError =
118 error.Fail() ? std::string(
error.AsCString()) +
"\n" :
"";
120 "%sthe replacement path doesn't exist: \"%s\"",
121 previousError.c_str(), replace_path);
133 if (argc >= 3 && (((argc - 1) & 1) == 0)) {
138 "invalid file list index %s, index must be 0 through %u",
141 bool changed =
false;
144 for (
size_t i = 1; i < argc; i += 2) {
153 std::string previousError =
154 error.Fail() ? std::string(
error.AsCString()) +
"\n" :
"";
156 "%sthe replacement path doesn't exist: \"%s\"",
157 previousError.c_str(), replace_path);
165 "insert operation takes an array index followed by "
166 "one or more path pairs");
172 std::vector<int> remove_indexes;
173 for (
size_t i = 0; i < argc; ++i) {
178 "invalid array index '%s', aborting remove operation",
182 remove_indexes.push_back(idx);
186 llvm::sort(remove_indexes);
187 for (
auto index : llvm::reverse(remove_indexes))
192 "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()
llvm::json::Value ToJSON(const ExecutionContext *exe_ctx) override
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
virtual Status SetValueFromString(llvm::StringRef value, VarSetOperationType op=eVarSetOperationAssign)
void NotifyValueChanged()
virtual const char * GetTypeAsCString() const
bool Remove(size_t index, bool notify)
bool Replace(llvm::StringRef path, llvm::StringRef replacement, bool notify)
void Insert(llvm::StringRef path, llvm::StringRef replacement, uint32_t insert_idx, bool notify)
void Append(llvm::StringRef path, llvm::StringRef replacement, bool notify)
llvm::json::Value ToJSON()
void Dump(Stream *s, int pair_index=-1)
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.
A class that represents a running process on the host machine.
VarSetOperationType
Settable state variable types.
@ eVarSetOperationReplace
@ eVarSetOperationInvalid
@ eVarSetOperationInsertBefore
@ eVarSetOperationInsertAfter