Go to the documentation of this file.
23 if (ref.equals_insensitive(
"false") || ref.equals_insensitive(
"off") ||
24 ref.equals_insensitive(
"no") || ref.equals_insensitive(
"0")) {
26 }
else if (ref.equals_insensitive(
"true") || ref.equals_insensitive(
"on") ||
27 ref.equals_insensitive(
"yes") || ref.equals_insensitive(
"1")) {
48 const OptionEnumValues &enum_values,
51 if (enum_values.empty()) {
52 error.SetErrorString(
"invalid enumeration argument");
57 error.SetErrorString(
"empty enumeration string");
61 for (
const auto &enum_value : enum_values) {
62 llvm::StringRef this_enum(enum_value.string_value);
63 if (this_enum.startswith(s))
64 return enum_value.value;
68 strm.
PutCString(
"invalid enumeration value, valid values are: ");
70 for (
const auto &enum_value : enum_values) {
72 is_first ? is_first =
false,
"" :
", ", enum_value.string_value);
79 size_t *byte_size_ptr) {
86 char *format_char =
nullptr;
87 unsigned long byte_size = ::strtoul(s, &format_char, 0);
88 if (byte_size != ULONG_MAX)
89 *byte_size_ptr = byte_size;
95 const bool partial_match_ok =
true;
99 "Invalid format character or name '%s'. Valid values are:\n", s);
103 error_strm.
Printf(
"'%c' or ", format_char);
111 "An optional byte size can precede the format character.\n");
118 error.SetErrorStringWithFormat(
"%s option string", s ?
"empty" :
"invalid");
128 if (s.equals_insensitive(
"python"))
130 if (s.equals_insensitive(
"lua"))
132 if (s.equals_insensitive(
"default"))
134 if (s.equals_insensitive(
"none"))
138 *success_ptr =
false;
146 bool error_set =
false;
154 llvm::StringRef sref = s;
157 if (!s.getAsInteger(0, addr)) {
164 if (!s.getAsInteger(16, addr)) {
178 lldb::ValueObjectSP valobj_sp;
188 bool success =
false;
191 valobj_sp = valobj_sp->GetQualifiedRepresentationIfAvailable(
192 valobj_sp->GetDynamicValueType(),
true);
195 addr = valobj_sp->GetValueAsUnsigned(fail_value, &success);
204 "address expression \"%s\" resulted in a value whose type "
205 "can't be converted to an address: %s",
206 s.str().c_str(), valobj_sp->GetTypeName().GetCString());
215 "^(.*)([-\\+])[[:space:]]*(0x[0-9A-Fa-f]+|[0-9]+)[[:space:]]*$");
217 llvm::SmallVector<llvm::StringRef, 4> matches;
218 if (g_symbol_plus_offset_regex.
Execute(sref, &matches)) {
223 if (!llvm::StringRef(str_offset).getAsInteger(0, offset)) {
228 return addr + offset;
230 return addr - offset;
238 "address expression \"%s\" evaluation failed", s.str().c_str());
ScriptLanguage
Script interpreter types.
Format
Display format definitions.
static char ToChar(llvm::StringRef s, char fail_value, bool *success_ptr)
ExpressionResults
The results of expression evaluation.
StackFrame * GetFramePtr() const
Returns a pointer to the frame object.
static lldb::ScriptLanguage ToScriptLanguage(llvm::StringRef s, lldb::ScriptLanguage fail_value, bool *success_ptr)
llvm::StringRef GetString() const
static llvm::raw_ostream & error(Stream &strm)
static Status ToFormat(const char *s, lldb::Format &format, size_t *byte_size_ptr)
int SetErrorStringWithFormat(const char *format,...) __attribute__((format(printf
Set the current error string to a formatted error string.
void SetTryAllThreads(bool try_others=true)
string(SUBSTRING ${p} 10 -1 pStripped) if($
void SetUnwindOnError(bool unwind=false)
void SetKeepInMemory(bool keep=true)
static bool ToBoolean(llvm::StringRef s, bool fail_value, bool *success_ptr)
void SetCoerceToId(bool coerce=true)
static int64_t ToOptionEnum(llvm::StringRef s, const OptionEnumValues &enum_values, int32_t fail_value, Status &error)
lldb::ExpressionResults EvaluateExpression(llvm::StringRef expression, ExecutionContextScope *exe_scope, lldb::ValueObjectSP &result_valobj_sp, const EvaluateExpressionOptions &options=EvaluateExpressionOptions(), std::string *fixed_expression=nullptr, ValueObject *ctx_obj=nullptr)
size_t EOL()
Output and End of Line character to the stream.
#define LLDB_INVALID_ADDRESS
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.
bool Execute(llvm::StringRef string, llvm::SmallVectorImpl< llvm::StringRef > *matches=nullptr) const
Execute a regular expression match using the compiled regular expression that is already in this obje...
void Clear()
Clear the object state.
size_t PutCString(llvm::StringRef cstr)
Output a C string to the stream.
Target * GetTargetPtr() const
Returns a pointer to the target object.
static lldb::addr_t ToAddress(const ExecutionContext *exe_ctx, llvm::StringRef s, lldb::addr_t fail_value, Status *error)