LLDB mainline
CommandObjectExpression.cpp
Go to the documentation of this file.
1//===-- CommandObjectExpression.cpp ---------------------------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#include "llvm/ADT/StringRef.h"
10
12#include "lldb/Core/Debugger.h"
21#include "lldb/Target/Process.h"
23#include "lldb/Target/Target.h"
25
26using namespace lldb;
27using namespace lldb_private;
28
30
32
33#define LLDB_OPTIONS_expression
34#include "CommandOptions.inc"
35
37 uint32_t option_idx, llvm::StringRef option_arg,
38 ExecutionContext *execution_context) {
40
41 const int short_option = GetDefinitions()[option_idx].short_option;
42
43 switch (short_option) {
44 case 'l':
47 StreamString sstr;
48 sstr.Printf("unknown language type: '%s' for expression. "
49 "List of supported languages:\n",
50 option_arg.str().c_str());
51
53 error.SetErrorString(sstr.GetString());
54 }
55 break;
56
57 case 'a': {
58 bool success;
59 bool result;
60 result = OptionArgParser::ToBoolean(option_arg, true, &success);
61 if (!success)
62 error.SetErrorStringWithFormat(
63 "invalid all-threads value setting: \"%s\"",
64 option_arg.str().c_str());
65 else
66 try_all_threads = result;
67 } break;
68
69 case 'i': {
70 bool success;
71 bool tmp_value = OptionArgParser::ToBoolean(option_arg, true, &success);
72 if (success)
73 ignore_breakpoints = tmp_value;
74 else
75 error.SetErrorStringWithFormat(
76 "could not convert \"%s\" to a boolean value.",
77 option_arg.str().c_str());
78 break;
79 }
80
81 case 'j': {
82 bool success;
83 bool tmp_value = OptionArgParser::ToBoolean(option_arg, true, &success);
84 if (success)
85 allow_jit = tmp_value;
86 else
87 error.SetErrorStringWithFormat(
88 "could not convert \"%s\" to a boolean value.",
89 option_arg.str().c_str());
90 break;
91 }
92
93 case 't':
94 if (option_arg.getAsInteger(0, timeout)) {
95 timeout = 0;
96 error.SetErrorStringWithFormat("invalid timeout setting \"%s\"",
97 option_arg.str().c_str());
98 }
99 break;
100
101 case 'u': {
102 bool success;
103 bool tmp_value = OptionArgParser::ToBoolean(option_arg, true, &success);
104 if (success)
105 unwind_on_error = tmp_value;
106 else
107 error.SetErrorStringWithFormat(
108 "could not convert \"%s\" to a boolean value.",
109 option_arg.str().c_str());
110 break;
111 }
112
113 case 'v':
114 if (option_arg.empty()) {
116 break;
117 }
120 option_arg, GetDefinitions()[option_idx].enum_values, 0, error);
121 if (!error.Success())
122 error.SetErrorStringWithFormat(
123 "unrecognized value for description-verbosity '%s'",
124 option_arg.str().c_str());
125 break;
126
127 case 'g':
128 debug = true;
129 unwind_on_error = false;
130 ignore_breakpoints = false;
131 break;
132
133 case 'p':
134 top_level = true;
135 break;
136
137 case 'X': {
138 bool success;
139 bool tmp_value = OptionArgParser::ToBoolean(option_arg, true, &success);
140 if (success)
142 else
143 error.SetErrorStringWithFormat(
144 "could not convert \"%s\" to a boolean value.",
145 option_arg.str().c_str());
146 break;
147 }
148
149 case '\x01': {
150 bool success;
151 bool persist_result =
152 OptionArgParser::ToBoolean(option_arg, true, &success);
153 if (success)
155 else
156 error.SetErrorStringWithFormat(
157 "could not convert \"%s\" to a boolean value.",
158 option_arg.str().c_str());
159 break;
160 }
161
162 default:
163 llvm_unreachable("Unimplemented option");
164 }
165
166 return error;
167}
168
170 ExecutionContext *execution_context) {
171 auto process_sp =
172 execution_context ? execution_context->GetProcessSP() : ProcessSP();
173 if (process_sp) {
174 ignore_breakpoints = process_sp->GetIgnoreBreakpointsInExpressions();
175 unwind_on_error = process_sp->GetUnwindOnErrorInExpressions();
176 } else {
177 ignore_breakpoints = true;
178 unwind_on_error = true;
179 }
180
181 show_summary = true;
182 try_all_threads = true;
183 timeout = 0;
184 debug = false;
185 language = eLanguageTypeUnknown;
187 auto_apply_fixits = eLazyBoolCalculate;
188 top_level = false;
189 allow_jit = true;
190 suppress_persistent_result = eLazyBoolCalculate;
191}
192
193llvm::ArrayRef<OptionDefinition>
195 return llvm::ArrayRef(g_expression_options);
196}
197
200 const Target &target, const OptionGroupValueObjectDisplay &display_opts) {
202 options.SetCoerceToId(display_opts.use_objc);
203 // Explicitly disabling persistent results takes precedence over the
204 // m_verbosity/use_objc logic.
205 if (suppress_persistent_result != eLazyBoolCalculate)
206 options.SetSuppressPersistentResult(suppress_persistent_result ==
209 options.SetSuppressPersistentResult(display_opts.use_objc);
210 options.SetUnwindOnError(unwind_on_error);
211 options.SetIgnoreBreakpoints(ignore_breakpoints);
212 options.SetKeepInMemory(true);
213 options.SetUseDynamic(display_opts.use_dynamic);
214 options.SetTryAllThreads(try_all_threads);
215 options.SetDebug(debug);
216 options.SetLanguage(language);
217 options.SetExecutionPolicy(
220
221 bool auto_apply_fixits;
222 if (this->auto_apply_fixits == eLazyBoolCalculate)
223 auto_apply_fixits = target.GetEnableAutoApplyFixIts();
224 else
225 auto_apply_fixits = this->auto_apply_fixits == eLazyBoolYes;
226
227 options.SetAutoApplyFixIts(auto_apply_fixits);
229
230 if (top_level)
232
233 // If there is any chance we are going to stop and want to see what went
234 // wrong with our expression, we should generate debug info
235 if (!ignore_breakpoints || !unwind_on_error)
236 options.SetGenerateDebugInfo(true);
237
238 if (timeout > 0)
239 options.SetTimeout(std::chrono::microseconds(timeout));
240 else
241 options.SetTimeout(std::nullopt);
242 return options;
243}
244
246 CommandInterpreter &interpreter)
247 : CommandObjectRaw(interpreter, "expression",
248 "Evaluate an expression on the current "
249 "thread. Displays any returned value "
250 "with LLDB's default formatting.",
251 "",
252 eCommandProcessMustBePaused | eCommandTryTargetAPILock),
255 m_repl_option(LLDB_OPT_SET_1, false, "repl", 'r', "Drop into REPL", false,
256 true),
259 R"(
260Single and multi-line expressions:
261
262)"
263 " The expression provided on the command line must be a complete expression \
264with no newlines. To evaluate a multi-line expression, \
265hit a return after an empty expression, and lldb will enter the multi-line expression editor. \
266Hit return on an empty line to end the multi-line expression."
267
268 R"(
269
270Timeouts:
271
272)"
273 " If the expression can be evaluated statically (without running code) then it will be. \
274Otherwise, by default the expression will run on the current thread with a short timeout: \
275currently .25 seconds. If it doesn't return in that time, the evaluation will be interrupted \
276and resumed with all threads running. You can use the -a option to disable retrying on all \
277threads. You can use the -t option to set a shorter timeout."
278 R"(
279
280User defined variables:
281
282)"
283 " You can define your own variables for convenience or to be used in subsequent expressions. \
284You define them the same way you would define variables in C. If the first character of \
285your user defined variable is a $, then the variable's value will be available in future \
286expressions, otherwise it will just be available in the current expression."
287 R"(
288
289Continuing evaluation after a breakpoint:
290
291)"
292 " If the \"-i false\" option is used, and execution is interrupted by a breakpoint hit, once \
293you are done with your investigation, you can either remove the expression execution frames \
294from the stack with \"thread return -x\" or if you are still interested in the expression result \
295you can issue the \"continue\" command and the expression evaluation will complete and the \
296expression result will be available using the \"thread.completed-expression\" key in the thread \
297format."
298
299 R"(
300
301Examples:
302
303 expr my_struct->a = my_array[3]
304 expr -f bin -- (index * 8) + 5
305 expr unsigned int $foo = 5
306 expr char c[] = \"foo\"; c[0])");
307
309 CommandArgumentData expression_arg;
310
311 // Define the first (and only) variant of this arg.
312 expression_arg.arg_type = eArgTypeExpression;
313 expression_arg.arg_repetition = eArgRepeatPlain;
315 // There is only one variant this argument could be; put it into the argument
316 // entry.
317 arg.push_back(expression_arg);
318
319 // Push the data for the first argument into the m_arguments vector.
320 m_arguments.push_back(arg);
321
322 // Add the "--format" and "--gdb-format"
332}
333
335
337
343 options.SetAutoApplyFixIts(false);
344 options.SetGenerateDebugInfo(false);
345
347
348 // Get out before we start doing things that expect a valid frame pointer.
349 if (exe_ctx.GetFramePtr() == nullptr)
350 return;
351
352 Target *exe_target = exe_ctx.GetTargetPtr();
353 Target &target = exe_target ? *exe_target : GetDummyTarget();
354
355 unsigned cursor_pos = request.GetRawCursorPos();
356 // Get the full user input including the suffix. The suffix is necessary
357 // as OptionsWithRaw will use it to detect if the cursor is cursor is in the
358 // argument part of in the raw input part of the arguments. If we cut of
359 // of the suffix then "expr -arg[cursor] --" would interpret the "-arg" as
360 // the raw input (as the "--" is hidden in the suffix).
361 llvm::StringRef code = request.GetRawLineWithUnusedSuffix();
362
363 const std::size_t original_code_size = code.size();
364
365 // Remove the first token which is 'expr' or some alias/abbreviation of that.
366 code = llvm::getToken(code).second.ltrim();
367 OptionsWithRaw args(code);
368 code = args.GetRawPart();
369
370 // The position where the expression starts in the command line.
371 assert(original_code_size >= code.size());
372 std::size_t raw_start = original_code_size - code.size();
373
374 // Check if the cursor is actually in the expression string, and if not, we
375 // exit.
376 // FIXME: We should complete the options here.
377 if (cursor_pos < raw_start)
378 return;
379
380 // Make the cursor_pos again relative to the start of the code string.
381 assert(cursor_pos >= raw_start);
382 cursor_pos -= raw_start;
383
384 auto language = exe_ctx.GetFrameRef().GetLanguage();
387 lldb::UserExpressionSP expr(target.GetUserExpressionForLanguage(
388 code, llvm::StringRef(), language, UserExpression::eResultTypeAny,
389 options, nullptr, error));
390 if (error.Fail())
391 return;
392
393 expr->Complete(exe_ctx, request, cursor_pos);
394}
395
398 CompilerType type(valobj.GetCompilerType());
399 CompilerType pointee;
400 if (!type.IsPointerType(&pointee))
401 return Status("as it does not refer to a pointer");
402 if (pointee.IsVoidType())
403 return Status("as it refers to a pointer to void");
404 return Status();
405}
406
407bool CommandObjectExpression::EvaluateExpression(llvm::StringRef expr,
408 Stream &output_stream,
409 Stream &error_stream,
410 CommandReturnObject &result) {
411 // Don't use m_exe_ctx as this might be called asynchronously after the
412 // command object DoExecute has finished when doing multi-line expression
413 // that use an input reader...
415 Target *exe_target = exe_ctx.GetTargetPtr();
416 Target &target = exe_target ? *exe_target : GetDummyTarget();
417
418 lldb::ValueObjectSP result_valobj_sp;
419 StackFrame *frame = exe_ctx.GetFramePtr();
420
423 "Can't disable JIT compilation for top-level expressions.\n");
424 return false;
425 }
426
427 const EvaluateExpressionOptions eval_options =
429 ExpressionResults success = target.EvaluateExpression(
430 expr, frame, result_valobj_sp, eval_options, &m_fixed_expression);
431
432 // We only tell you about the FixIt if we applied it. The compiler errors
433 // will suggest the FixIt if it parsed.
434 if (!m_fixed_expression.empty() && target.GetEnableNotifyAboutFixIts()) {
435 error_stream.Printf(" Fix-it applied, fixed expression was: \n %s\n",
436 m_fixed_expression.c_str());
437 }
438
439 if (result_valobj_sp) {
441
442 if (result_valobj_sp->GetError().Success()) {
443 if (format != eFormatVoid) {
444 if (format != eFormatDefault)
445 result_valobj_sp->SetFormat(format);
446
449 if (error.Fail()) {
451 "expression cannot be used with --element-count %s\n",
452 error.AsCString(""));
453 return false;
454 }
455 }
456
459 options.SetHideRootName(eval_options.GetSuppressPersistentResult());
460 options.SetVariableFormatDisplayLanguage(
461 result_valobj_sp->GetPreferredDisplayLanguage());
462
463 result_valobj_sp->Dump(output_stream, options);
464
466 }
467 } else {
468 if (result_valobj_sp->GetError().GetError() ==
470 if (format != eFormatVoid && GetDebugger().GetNotifyVoid()) {
471 error_stream.PutCString("(void)\n");
472 }
473
475 } else {
476 const char *error_cstr = result_valobj_sp->GetError().AsCString();
477 if (error_cstr && error_cstr[0]) {
478 const size_t error_cstr_len = strlen(error_cstr);
479 const bool ends_with_newline = error_cstr[error_cstr_len - 1] == '\n';
480 if (strstr(error_cstr, "error:") != error_cstr)
481 error_stream.PutCString("error: ");
482 error_stream.Write(error_cstr, error_cstr_len);
483 if (!ends_with_newline)
484 error_stream.EOL();
485 } else {
486 error_stream.PutCString("error: unknown error\n");
487 }
488
490 }
491 }
492 } else {
493 error_stream.Printf("error: unknown error\n");
494 }
495
496 return (success != eExpressionSetupError &&
497 success != eExpressionParseError);
498}
499
501 std::string &line) {
502 io_handler.SetIsDone(true);
503 StreamFileSP output_sp = io_handler.GetOutputStreamFileSP();
504 StreamFileSP error_sp = io_handler.GetErrorStreamFileSP();
505
507 GetCommandInterpreter().GetDebugger().GetUseColor());
508 EvaluateExpression(line.c_str(), *output_sp, *error_sp, return_obj);
509 if (output_sp)
510 output_sp->Flush();
511 if (error_sp)
512 error_sp->Flush();
513}
514
516 StringList &lines) {
517 // An empty lines is used to indicate the end of input
518 const size_t num_lines = lines.GetSize();
519 if (num_lines > 0 && lines[num_lines - 1].empty()) {
520 // Remove the last empty line from "lines" so it doesn't appear in our
521 // resulting input and return true to indicate we are done getting lines
522 lines.PopBack();
523 return true;
524 }
525 return false;
526}
527
529 m_expr_lines.clear();
531
533 bool color_prompt = debugger.GetUseColor();
534 const bool multiple_lines = true; // Get multiple lines
535 IOHandlerSP io_handler_sp(
537 "lldb-expr", // Name of input reader for history
538 llvm::StringRef(), // No prompt
539 llvm::StringRef(), // Continuation prompt
540 multiple_lines, color_prompt,
541 1, // Show line numbers starting at 1
542 *this));
543
544 StreamFileSP output_sp = io_handler_sp->GetOutputStreamFileSP();
545 if (output_sp) {
546 output_sp->PutCString(
547 "Enter expressions, then terminate with an empty line to evaluate:\n");
548 output_sp->Flush();
549 }
550 debugger.RunIOHandlerAsync(io_handler_sp);
551}
552
556 command_options.OptionParsingStarting(&ctx);
557
558 // Default certain settings for REPL regardless of the global settings.
559 command_options.unwind_on_error = false;
560 command_options.ignore_breakpoints = false;
561 command_options.debug = false;
562
563 EvaluateExpressionOptions expr_options;
564 expr_options.SetUnwindOnError(command_options.unwind_on_error);
565 expr_options.SetIgnoreBreakpoints(command_options.ignore_breakpoints);
566 expr_options.SetTryAllThreads(command_options.try_all_threads);
567
568 if (command_options.timeout > 0)
569 expr_options.SetTimeout(std::chrono::microseconds(command_options.timeout));
570 else
571 expr_options.SetTimeout(std::nullopt);
572
573 return expr_options;
574}
575
576bool CommandObjectExpression::DoExecute(llvm::StringRef command,
577 CommandReturnObject &result) {
578 m_fixed_expression.clear();
581
582 if (command.empty()) {
584 return result.Succeeded();
585 }
586
587 OptionsWithRaw args(command);
588 llvm::StringRef expr = args.GetRawPart();
589
590 if (args.HasArgs()) {
591 if (!ParseOptionsAndNotify(args.GetArgs(), result, m_option_group, exe_ctx))
592 return false;
593
596 // Drop into REPL
597 m_expr_lines.clear();
599
600 Debugger &debugger = target.GetDebugger();
601
602 // Check if the LLDB command interpreter is sitting on top of a REPL
603 // that launched it...
606 // the LLDB command interpreter is sitting on top of a REPL that
607 // launched it, so just say the command interpreter is done and
608 // fall back to the existing REPL
609 m_interpreter.GetIOHandler(false)->SetIsDone(true);
610 } else {
611 // We are launching the REPL on top of the current LLDB command
612 // interpreter, so just push one
613 bool initialize = false;
614 Status repl_error;
615 REPLSP repl_sp(target.GetREPL(repl_error, m_command_options.language,
616 nullptr, false));
617
618 if (!repl_sp) {
619 initialize = true;
620 repl_sp = target.GetREPL(repl_error, m_command_options.language,
621 nullptr, true);
622 if (!repl_error.Success()) {
623 result.SetError(repl_error);
624 return result.Succeeded();
625 }
626 }
627
628 if (repl_sp) {
629 if (initialize) {
630 repl_sp->SetEvaluateOptions(
632 repl_sp->SetFormatOptions(m_format_options);
633 repl_sp->SetValueObjectDisplayOptions(m_varobj_options);
634 }
635
636 IOHandlerSP io_handler_sp(repl_sp->GetIOHandler());
637 io_handler_sp->SetIsDone(false);
638 debugger.RunIOHandlerAsync(io_handler_sp);
639 } else {
640 repl_error.SetErrorStringWithFormat(
641 "Couldn't create a REPL for %s",
643 result.SetError(repl_error);
644 return result.Succeeded();
645 }
646 }
647 }
648 // No expression following options
649 else if (expr.empty()) {
651 return result.Succeeded();
652 }
653 }
654
656 if (EvaluateExpression(expr, result.GetOutputStream(),
657 result.GetErrorStream(), result)) {
658
659 if (!m_fixed_expression.empty() && target.GetEnableNotifyAboutFixIts()) {
661 // FIXME: Can we figure out what the user actually typed (e.g. some alias
662 // for expr???)
663 // If we can it would be nice to show that.
664 std::string fixed_command("expression ");
665 if (args.HasArgs()) {
666 // Add in any options that might have been in the original command:
667 fixed_command.append(std::string(args.GetArgStringWithDelimiter()));
668 fixed_command.append(m_fixed_expression);
669 } else
670 fixed_command.append(m_fixed_expression);
671 history.AppendString(fixed_command);
672 }
673 return true;
674 }
676 return false;
677}
static lldb_private::Status CanBeUsedForElementCountPrinting(ValueObject &valobj)
static EvaluateExpressionOptions GetExprOptions(ExecutionContext &ctx, CommandObjectExpression::CommandOptions command_options)
static llvm::raw_ostream & error(Stream &strm)
void AppendString(llvm::StringRef str, bool reject_if_dupe=true)
ExecutionContext GetExecutionContext() const
lldb::IOHandlerSP GetIOHandler(bool force_create=false, CommandInterpreterRunOptions *options=nullptr)
void OptionParsingStarting(ExecutionContext *execution_context) override
llvm::ArrayRef< OptionDefinition > GetDefinitions() override
LanguageRuntimeDescriptionDisplayVerbosity m_verbosity
Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_value, ExecutionContext *execution_context) override
EvaluateExpressionOptions GetEvaluateExpressionOptions(const Target &target, const OptionGroupValueObjectDisplay &display_opts)
Return the appropriate expression options used for evaluating the expression in the given target.
bool DoExecute(llvm::StringRef command, CommandReturnObject &result) override
CommandObjectExpression(CommandInterpreter &interpreter)
bool IOHandlerIsInputComplete(IOHandler &io_handler, StringList &lines) override
Called to determine whether typing enter after the last line in lines should end input.
OptionGroupValueObjectDisplay m_varobj_options
void HandleCompletion(CompletionRequest &request) override
This default version handles calling option argument completions and then calls HandleArgumentComplet...
bool EvaluateExpression(llvm::StringRef expr, Stream &output_stream, Stream &error_stream, CommandReturnObject &result)
Evaluates the given expression.
void IOHandlerInputComplete(IOHandler &io_handler, std::string &line) override
Called when a line or lines have been retrieved.
std::vector< CommandArgumentData > CommandArgumentEntry
virtual void SetHelpLong(llvm::StringRef str)
bool ParseOptionsAndNotify(Args &args, CommandReturnObject &result, OptionGroupOptions &group_options, ExecutionContext &exe_ctx)
std::vector< CommandArgumentEntry > m_arguments
CommandInterpreter & GetCommandInterpreter()
CommandInterpreter & m_interpreter
Target & GetSelectedOrDummyTarget(bool prefer_dummy=false)
void SetStatus(lldb::ReturnStatus status)
void AppendErrorWithFormat(const char *format,...) __attribute__((format(printf
void SetError(const Status &error, const char *fallback_error_cstr=nullptr)
Generic representation of a type in a programming language.
Definition: CompilerType.h:36
"lldb/Utility/ArgCompletionRequest.h"
llvm::StringRef GetRawLineWithUnusedSuffix() const
Returns the full raw user input used to create this CompletionRequest.
A class to manage flag bits.
Definition: Debugger.h:78
bool GetUseColor() const
Definition: Debugger.cpp:375
void RunIOHandlerAsync(const lldb::IOHandlerSP &reader_sp, bool cancel_top_handler=true)
Run the given IO handler and return immediately.
Definition: Debugger.cpp:1125
bool CheckTopIOHandlerTypes(IOHandler::Type top_type, IOHandler::Type second_top_type)
Definition: Debugger.cpp:1095
void SetLanguage(lldb::LanguageType language)
Definition: Target.h:305
void SetUnwindOnError(bool unwind=false)
Definition: Target.h:324
void SetExecutionPolicy(ExecutionPolicy policy=eExecutionPolicyAlways)
Definition: Target.h:299
void SetKeepInMemory(bool keep=true)
Definition: Target.h:334
void SetCoerceToId(bool coerce=true)
Definition: Target.h:320
void SetTryAllThreads(bool try_others=true)
Definition: Target.h:357
void SetRetriesWithFixIts(uint64_t number_of_retries)
Definition: Target.h:426
void SetTimeout(const Timeout< std::micro > &timeout)
Definition: Target.h:345
static constexpr ExecutionPolicy default_execution_policy
Definition: Target.h:292
void SetIgnoreBreakpoints(bool ignore=false)
Definition: Target.h:328
void SetUseDynamic(lldb::DynamicValueType dynamic=lldb::eDynamicCanRunTarget)
Definition: Target.h:339
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
const lldb::ProcessSP & GetProcessSP() const
Get accessor to get the process shared pointer.
Encapsulates a single expression for use in lldb.
Definition: Expression.h:33
A delegate class for use with IOHandler subclasses.
Definition: IOHandler.h:191
lldb::StreamFileSP GetErrorStreamFileSP()
Definition: IOHandler.cpp:107
lldb::StreamFileSP GetOutputStreamFileSP()
Definition: IOHandler.cpp:105
void SetIsDone(bool b)
Definition: IOHandler.h:87
static void PrintSupportedLanguagesForExpressions(Stream &s, llvm::StringRef prefix, llvm::StringRef suffix)
Prints to the specified stream 's' each language type that the current target supports for expression...
Definition: Language.cpp:223
static const char * GetNameForLanguageType(lldb::LanguageType language)
Definition: Language.cpp:216
static lldb::LanguageType GetLanguageTypeFromString(const char *string)=delete
OptionValueBoolean & GetOptionValue()
static const uint32_t OPTION_GROUP_GDB_FMT
static const uint32_t OPTION_GROUP_FORMAT
void Append(OptionGroup *group)
Append options from a OptionGroup class.
Definition: Options.cpp:755
DumpValueObjectOptions GetAsDumpOptions(LanguageRuntimeDescriptionDisplayVerbosity lang_descr_verbosity=eLanguageRuntimeDescriptionDisplayVerbosityFull, lldb::Format format=lldb::eFormatDefault, lldb::TypeSummaryImplSP summary_sp=lldb::TypeSummaryImplSP())
A pair of an option list with a 'raw' string as a suffix.
Definition: Args.h:315
A command line option parsing protocol class.
Definition: Options.h:58
void NotifyOptionParsingStarting(ExecutionContext *execution_context)
Definition: Options.cpp:33
This base class provides an interface to stack frames.
Definition: StackFrame.h:41
An error handling class.
Definition: Status.h:44
int SetErrorStringWithFormat(const char *format,...) __attribute__((format(printf
Set the current error string to a formatted error string.
Definition: Status.cpp:255
bool Success() const
Test for success condition.
Definition: Status.cpp:287
llvm::StringRef GetString() const
A stream class that can stream formatted output to a file.
Definition: Stream.h:28
size_t Write(const void *src, size_t src_len)
Output character bytes to the stream.
Definition: Stream.h:101
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
Definition: Stream.cpp:107
size_t PutCString(llvm::StringRef cstr)
Output a C string to the stream.
Definition: Stream.cpp:63
size_t EOL()
Output and End of Line character to the stream.
Definition: Stream.cpp:128
size_t GetSize() const
Definition: StringList.cpp:74
bool GetEnableNotifyAboutFixIts() const
Definition: Target.cpp:4437
uint64_t GetNumberOfRetriesWithFixits() const
Definition: Target.cpp:4431
bool GetEnableAutoApplyFixIts() const
Definition: Target.cpp:4425
UserExpression * GetUserExpressionForLanguage(llvm::StringRef expr, llvm::StringRef prefix, lldb::LanguageType language, Expression::ResultType desired_type, const EvaluateExpressionOptions &options, ValueObject *ctx_obj, Status &error)
Definition: Target.cpp:2415
Debugger & GetDebugger()
Definition: Target.h:1031
lldb::REPLSP GetREPL(Status &err, lldb::LanguageType language, const char *repl_options, bool can_create)
Definition: Target.cpp:220
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)
Definition: Target.cpp:2543
static const Status::ValueType kNoResult
ValueObject::GetError() returns this if there is no result from the expression.
CompilerType GetCompilerType()
Definition: ValueObject.h:352
#define LLDB_OPT_SET_1
Definition: lldb-defines.h:102
#define LLDB_OPT_SET_2
Definition: lldb-defines.h:103
#define LLDB_OPT_SET_ALL
Definition: lldb-defines.h:101
#define LLDB_OPT_SET_3
Definition: lldb-defines.h:104
A class that represents a running process on the host machine.
Definition: SBAttachInfo.h:14
@ eLanguageRuntimeDescriptionDisplayVerbosityCompact
Definition: SBAddress.h:15
Format
Display format definitions.
@ eFormatVoid
Do not print this.
@ eLanguageTypeUnknown
Unknown or invalid language value.
ExpressionResults
The results of expression evaluation.
@ eExpressionParseError
@ eExpressionSetupError
@ eReturnStatusFailed
@ eReturnStatusSuccessFinishResult
@ eArgTypeExpression
Used to build individual command argument lists.
Definition: CommandObject.h:93
static int64_t ToOptionEnum(llvm::StringRef s, const OptionEnumValues &enum_values, int32_t fail_value, Status &error)
static bool ToBoolean(llvm::StringRef s, bool fail_value, bool *success_ptr)