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
10#include "lldb/Core/Debugger.h"
20#include "lldb/Target/Process.h"
22#include "lldb/Target/Target.h"
26
27using namespace lldb;
28using namespace lldb_private;
29
31
33
34#define LLDB_OPTIONS_expression
35#include "CommandOptions.inc"
36
38 uint32_t option_idx, llvm::StringRef option_arg,
39 ExecutionContext *execution_context) {
41
42 const int short_option = GetDefinitions()[option_idx].short_option;
43
44 switch (short_option) {
45 case 'l':
48 StreamString sstr;
49 sstr.Printf("unknown language type: '%s' for expression. "
50 "List of supported languages:\n",
51 option_arg.str().c_str());
52
54 error = Status(sstr.GetString().str());
55 }
56 break;
57
58 case 'a': {
59 bool success;
60 bool result;
61 result = OptionArgParser::ToBoolean(option_arg, true, &success);
62 if (!success)
64 "invalid all-threads value setting: \"%s\"",
65 option_arg.str().c_str());
66 else
67 try_all_threads = result;
68 } break;
69
70 case 'i': {
71 bool success;
72 bool tmp_value = OptionArgParser::ToBoolean(option_arg, true, &success);
73 if (success)
74 ignore_breakpoints = tmp_value;
75 else
77 "could not convert \"%s\" to a boolean value.",
78 option_arg.str().c_str());
79 break;
80 }
81
82 case 'j': {
83 bool success;
84 bool tmp_value = OptionArgParser::ToBoolean(option_arg, true, &success);
85 if (success)
86 allow_jit = tmp_value;
87 else
89 "could not convert \"%s\" to a boolean value.",
90 option_arg.str().c_str());
91 break;
92 }
93
94 case 't':
95 if (option_arg.getAsInteger(0, timeout)) {
96 timeout = 0;
98 "invalid timeout setting \"%s\"", option_arg.str().c_str());
99 }
100 break;
101
102 case 'u': {
103 bool success;
104 bool tmp_value = OptionArgParser::ToBoolean(option_arg, true, &success);
105 if (success)
106 unwind_on_error = tmp_value;
107 else
109 "could not convert \"%s\" to a boolean value.",
110 option_arg.str().c_str());
111 break;
112 }
113
114 case 'v':
115 if (option_arg.empty()) {
117 break;
118 }
121 option_arg, GetDefinitions()[option_idx].enum_values, 0, error);
122 if (!error.Success())
124 "unrecognized value for description-verbosity '%s'",
125 option_arg.str().c_str());
126 break;
127
128 case 'g':
129 debug = true;
130 unwind_on_error = false;
131 ignore_breakpoints = false;
132 break;
133
134 case 'p':
135 top_level = true;
136 break;
137
138 case 'X': {
139 bool success;
140 bool tmp_value = OptionArgParser::ToBoolean(option_arg, true, &success);
141 if (success)
143 else
145 "could not convert \"%s\" to a boolean value.",
146 option_arg.str().c_str());
147 break;
148 }
149
150 case '\x01': {
151 bool success;
152 bool persist_result =
153 OptionArgParser::ToBoolean(option_arg, true, &success);
154 if (success)
156 else
158 "could not convert \"%s\" to a boolean value.",
159 option_arg.str().c_str());
160 break;
161 }
162
163 default:
164 llvm_unreachable("Unimplemented option");
165 }
166
167 return error;
168}
169
171 ExecutionContext *execution_context) {
172 auto process_sp =
173 execution_context ? execution_context->GetProcessSP() : ProcessSP();
174 if (process_sp) {
175 ignore_breakpoints = process_sp->GetIgnoreBreakpointsInExpressions();
176 unwind_on_error = process_sp->GetUnwindOnErrorInExpressions();
177 } else {
178 ignore_breakpoints = true;
179 unwind_on_error = true;
180 }
181
182 show_summary = true;
183 try_all_threads = true;
184 timeout = 0;
185 debug = false;
186 language = eLanguageTypeUnknown;
188 auto_apply_fixits = eLazyBoolCalculate;
189 top_level = false;
190 allow_jit = true;
191 suppress_persistent_result = eLazyBoolCalculate;
192}
193
194llvm::ArrayRef<OptionDefinition>
196 return llvm::ArrayRef(g_expression_options);
197}
198
201 const Target &target, const OptionGroupValueObjectDisplay &display_opts) {
203 options.SetCoerceToId(display_opts.use_objc);
204 options.SetUnwindOnError(unwind_on_error);
205 options.SetIgnoreBreakpoints(ignore_breakpoints);
206 options.SetKeepInMemory(true);
207 options.SetUseDynamic(display_opts.use_dynamic);
208 options.SetTryAllThreads(try_all_threads);
209 options.SetDebug(debug);
210 options.SetLanguage(language);
211 options.SetExecutionPolicy(
214
215 bool auto_apply_fixits;
216 if (this->auto_apply_fixits == eLazyBoolCalculate)
217 auto_apply_fixits = target.GetEnableAutoApplyFixIts();
218 else
219 auto_apply_fixits = this->auto_apply_fixits == eLazyBoolYes;
220
221 options.SetAutoApplyFixIts(auto_apply_fixits);
223
224 if (top_level)
226
227 // If there is any chance we are going to stop and want to see what went
228 // wrong with our expression, we should generate debug info
229 if (!ignore_breakpoints || !unwind_on_error)
230 options.SetGenerateDebugInfo(true);
231
232 if (timeout > 0)
233 options.SetTimeout(std::chrono::microseconds(timeout));
234 else
235 options.SetTimeout(std::nullopt);
236 return options;
237}
238
240 const OptionGroupValueObjectDisplay &display_opts) const {
241 // Explicitly disabling persistent results takes precedence over the
242 // m_verbosity/use_objc logic.
243 if (suppress_persistent_result != eLazyBoolCalculate)
244 return suppress_persistent_result == eLazyBoolYes;
245
246 return display_opts.use_objc &&
248}
249
251 CommandInterpreter &interpreter)
252 : CommandObjectRaw(interpreter, "expression",
253 "Evaluate an expression on the current "
254 "thread. Displays any returned value "
255 "with LLDB's default formatting.",
256 "",
257 eCommandProcessMustBePaused | eCommandTryTargetAPILock),
260 m_repl_option(LLDB_OPT_SET_1, false, "repl", 'r', "Drop into REPL", false,
261 true),
264 R"(
265Single and multi-line expressions:
266
267)"
268 " The expression provided on the command line must be a complete expression \
269with no newlines. To evaluate a multi-line expression, \
270hit a return after an empty expression, and lldb will enter the multi-line expression editor. \
271Hit return on an empty line to end the multi-line expression."
272
273 R"(
274
275Timeouts:
276
277)"
278 " If the expression can be evaluated statically (without running code) then it will be. \
279Otherwise, by default the expression will run on the current thread with a short timeout: \
280currently .25 seconds. If it doesn't return in that time, the evaluation will be interrupted \
281and resumed with all threads running. You can use the -a option to disable retrying on all \
282threads. You can use the -t option to set a shorter timeout."
283 R"(
284
285User defined variables:
286
287)"
288 " You can define your own variables for convenience or to be used in subsequent expressions. \
289You define them the same way you would define variables in C. If the first character of \
290your user defined variable is a $, then the variable's value will be available in future \
291expressions, otherwise it will just be available in the current expression."
292 R"(
293
294Continuing evaluation after a breakpoint:
295
296)"
297 " If the \"-i false\" option is used, and execution is interrupted by a breakpoint hit, once \
298you are done with your investigation, you can either remove the expression execution frames \
299from the stack with \"thread return -x\" or if you are still interested in the expression result \
300you can issue the \"continue\" command and the expression evaluation will complete and the \
301expression result will be available using the \"thread.completed-expression\" key in the thread \
302format."
303
304 R"(
305
306Examples:
308 expr my_struct->a = my_array[3]
309 expr -f bin -- (index * 8) + 5
310 expr unsigned int $foo = 5
311 expr char c[] = \"foo\"; c[0])");
312
314
315 // Add the "--format" and "--gdb-format"
325}
326
328
330
336 options.SetAutoApplyFixIts(false);
337 options.SetGenerateDebugInfo(false);
338
340
341 // Get out before we start doing things that expect a valid frame pointer.
342 if (exe_ctx.GetFramePtr() == nullptr)
343 return;
344
345 Target *exe_target = exe_ctx.GetTargetPtr();
346 Target &target = exe_target ? *exe_target : GetDummyTarget();
347
348 unsigned cursor_pos = request.GetRawCursorPos();
349 // Get the full user input including the suffix. The suffix is necessary
350 // as OptionsWithRaw will use it to detect if the cursor is cursor is in the
351 // argument part of in the raw input part of the arguments. If we cut of
352 // of the suffix then "expr -arg[cursor] --" would interpret the "-arg" as
353 // the raw input (as the "--" is hidden in the suffix).
354 llvm::StringRef code = request.GetRawLineWithUnusedSuffix();
355
356 const std::size_t original_code_size = code.size();
357
358 // Remove the first token which is 'expr' or some alias/abbreviation of that.
359 code = llvm::getToken(code).second.ltrim();
360 OptionsWithRaw args(code);
361 code = args.GetRawPart();
362
363 // The position where the expression starts in the command line.
364 assert(original_code_size >= code.size());
365 std::size_t raw_start = original_code_size - code.size();
366
367 // Check if the cursor is actually in the expression string, and if not, we
368 // exit.
369 // FIXME: We should complete the options here.
370 if (cursor_pos < raw_start)
371 return;
372
373 // Make the cursor_pos again relative to the start of the code string.
374 assert(cursor_pos >= raw_start);
375 cursor_pos -= raw_start;
376
377 auto language = exe_ctx.GetFrameRef().GetLanguage();
381 code, llvm::StringRef(), language, UserExpression::eResultTypeAny,
382 options, nullptr, error));
383 if (error.Fail())
384 return;
385
386 expr->Complete(exe_ctx, request, cursor_pos);
387}
388
391 CompilerType type(valobj.GetCompilerType());
392 CompilerType pointee;
393 if (!type.IsPointerType(&pointee))
394 return Status::FromErrorString("as it does not refer to a pointer");
395 if (pointee.IsVoidType())
396 return Status::FromErrorString("as it refers to a pointer to void");
397 return Status();
398}
399
400bool CommandObjectExpression::EvaluateExpression(llvm::StringRef expr,
401 Stream &output_stream,
402 Stream &error_stream,
403 CommandReturnObject &result) {
404 // Don't use m_exe_ctx as this might be called asynchronously after the
405 // command object DoExecute has finished when doing multi-line expression
406 // that use an input reader...
408 Target *exe_target = exe_ctx.GetTargetPtr();
409 Target &target = exe_target ? *exe_target : GetDummyTarget();
410
411 lldb::ValueObjectSP result_valobj_sp;
412 StackFrame *frame = exe_ctx.GetFramePtr();
413
416 "Can't disable JIT compilation for top-level expressions.\n");
417 return false;
418 }
419
420 EvaluateExpressionOptions eval_options =
422 // This command manually removes the result variable, make sure expression
423 // evaluation doesn't do it first.
424 eval_options.SetSuppressPersistentResult(false);
425
426 ExpressionResults success = target.EvaluateExpression(
427 expr, frame, result_valobj_sp, eval_options, &m_fixed_expression);
428
429 // Only mention Fix-Its if the expression evaluator applied them.
430 // Compiler errors refer to the final expression after applying Fix-It(s).
431 if (!m_fixed_expression.empty() && target.GetEnableNotifyAboutFixIts()) {
432 error_stream << " Evaluated this expression after applying Fix-It(s):\n";
433 error_stream << " " << m_fixed_expression << "\n";
434 }
435
436 if (result_valobj_sp) {
438
439 if (result_valobj_sp->GetError().Success()) {
440 if (format != eFormatVoid) {
441 if (format != eFormatDefault)
442 result_valobj_sp->SetFormat(format);
443
446 if (error.Fail()) {
448 "expression cannot be used with --element-count %s\n",
449 error.AsCString(""));
450 return false;
451 }
452 }
453
454 bool suppress_result =
456
459 options.SetHideRootName(suppress_result);
460 options.SetVariableFormatDisplayLanguage(
461 result_valobj_sp->GetPreferredDisplayLanguage());
462
463 if (llvm::Error error =
464 result_valobj_sp->Dump(output_stream, options)) {
465 result.AppendError(toString(std::move(error)));
466 return false;
467 }
468
469 if (suppress_result)
470 if (auto result_var_sp =
471 target.GetPersistentVariable(result_valobj_sp->GetName())) {
472 auto language = result_valobj_sp->GetPreferredDisplayLanguage();
473 if (auto *persistent_state =
475 persistent_state->RemovePersistentVariable(result_var_sp);
476 }
479 } else {
480 if (result_valobj_sp->GetError().GetError() ==
482 if (format != eFormatVoid && GetDebugger().GetNotifyVoid()) {
483 error_stream.PutCString("(void)\n");
484 }
485
487 } else {
489 result.SetError(result_valobj_sp->GetError().ToError());
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
506 CommandReturnObject return_obj(
507 GetCommandInterpreter().GetDebugger().GetUseColor());
508 EvaluateExpression(line.c_str(), *output_sp, *error_sp, return_obj);
510 if (output_sp)
511 output_sp->Flush();
512 if (error_sp) {
513 *error_sp << return_obj.GetErrorString();
514 error_sp->Flush();
515 }
516}
517
519 StringList &lines) {
520 // An empty lines is used to indicate the end of input
521 const size_t num_lines = lines.GetSize();
522 if (num_lines > 0 && lines[num_lines - 1].empty()) {
523 // Remove the last empty line from "lines" so it doesn't appear in our
524 // resulting input and return true to indicate we are done getting lines
525 lines.PopBack();
526 return true;
527 }
528 return false;
529}
530
532 m_expr_lines.clear();
534
536 bool color_prompt = debugger.GetUseColor();
537 const bool multiple_lines = true; // Get multiple lines
538 IOHandlerSP io_handler_sp(
540 "lldb-expr", // Name of input reader for history
541 llvm::StringRef(), // No prompt
542 llvm::StringRef(), // Continuation prompt
543 multiple_lines, color_prompt,
544 1, // Show line numbers starting at 1
545 *this));
546
547 StreamFileSP output_sp = io_handler_sp->GetOutputStreamFileSP();
548 if (output_sp) {
549 output_sp->PutCString(
550 "Enter expressions, then terminate with an empty line to evaluate:\n");
551 output_sp->Flush();
552 }
553 debugger.RunIOHandlerAsync(io_handler_sp);
554}
555
559 command_options.OptionParsingStarting(&ctx);
560
561 // Default certain settings for REPL regardless of the global settings.
562 command_options.unwind_on_error = false;
563 command_options.ignore_breakpoints = false;
564 command_options.debug = false;
565
566 EvaluateExpressionOptions expr_options;
567 expr_options.SetUnwindOnError(command_options.unwind_on_error);
568 expr_options.SetIgnoreBreakpoints(command_options.ignore_breakpoints);
569 expr_options.SetTryAllThreads(command_options.try_all_threads);
570
571 if (command_options.timeout > 0)
572 expr_options.SetTimeout(std::chrono::microseconds(command_options.timeout));
573 else
574 expr_options.SetTimeout(std::nullopt);
575
576 return expr_options;
577}
578
579void CommandObjectExpression::DoExecute(llvm::StringRef command,
580 CommandReturnObject &result) {
581 m_fixed_expression.clear();
584
585 if (command.empty()) {
587 return;
588 }
589
590 OptionsWithRaw args(command);
591 llvm::StringRef expr = args.GetRawPart();
592
593 if (args.HasArgs()) {
594 if (!ParseOptionsAndNotify(args.GetArgs(), result, m_option_group, exe_ctx))
595 return;
596
598 Target &target = GetTarget();
599 // Drop into REPL
600 m_expr_lines.clear();
602
603 Debugger &debugger = target.GetDebugger();
604
605 // Check if the LLDB command interpreter is sitting on top of a REPL
606 // that launched it...
609 // the LLDB command interpreter is sitting on top of a REPL that
610 // launched it, so just say the command interpreter is done and
611 // fall back to the existing REPL
612 m_interpreter.GetIOHandler(false)->SetIsDone(true);
613 } else {
614 // We are launching the REPL on top of the current LLDB command
615 // interpreter, so just push one
616 bool initialize = false;
617 Status repl_error;
618 REPLSP repl_sp(target.GetREPL(repl_error, m_command_options.language,
619 nullptr, false));
620
621 if (!repl_sp) {
622 initialize = true;
623 repl_sp = target.GetREPL(repl_error, m_command_options.language,
624 nullptr, true);
625 if (repl_error.Fail()) {
626 result.SetError(std::move(repl_error));
627 return;
628 }
629 }
630
631 if (repl_sp) {
632 if (initialize) {
633 repl_sp->SetEvaluateOptions(
635 repl_sp->SetFormatOptions(m_format_options);
636 repl_sp->SetValueObjectDisplayOptions(m_varobj_options);
637 }
638
639 IOHandlerSP io_handler_sp(repl_sp->GetIOHandler());
640 io_handler_sp->SetIsDone(false);
641 debugger.RunIOHandlerAsync(io_handler_sp);
642 } else {
644 "Couldn't create a REPL for %s",
646 result.SetError(std::move(repl_error));
647 return;
648 }
649 }
650 }
651 // No expression following options
652 else if (expr.empty()) {
654 return;
655 }
656 }
657
658 // Previously the indent was set up for diagnosing command line
659 // parsing errors. Now point it to the expression.
660 std::optional<uint16_t> indent;
661 size_t pos = m_original_command.rfind(expr);
662 if (pos != llvm::StringRef::npos)
663 indent = pos;
664 result.SetDiagnosticIndent(indent);
665
666 Target &target = GetTarget();
667 if (EvaluateExpression(expr, result.GetOutputStream(),
668 result.GetErrorStream(), result)) {
669
670 if (!m_fixed_expression.empty() && target.GetEnableNotifyAboutFixIts()) {
672 // FIXME: Can we figure out what the user actually typed (e.g. some alias
673 // for expr???)
674 // If we can it would be nice to show that.
675 std::string fixed_command("expression ");
676 if (args.HasArgs()) {
677 // Add in any options that might have been in the original command:
678 fixed_command.append(std::string(args.GetArgStringWithDelimiter()));
679 fixed_command.append(m_fixed_expression);
680 } else
681 fixed_command.append(m_fixed_expression);
682 history.AppendString(fixed_command);
683 }
684 return;
685 }
687}
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
bool ShouldSuppressResult(const OptionGroupValueObjectDisplay &display_opts) const
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.
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.
void DoExecute(llvm::StringRef command, CommandReturnObject &result) override
virtual void SetHelpLong(llvm::StringRef str)
void AddSimpleArgumentList(lldb::CommandArgumentType arg_type, ArgumentRepetitionType repetition_type=eArgRepeatPlain)
bool ParseOptionsAndNotify(Args &args, CommandReturnObject &result, OptionGroupOptions &group_options, ExecutionContext &exe_ctx)
CommandInterpreter & GetCommandInterpreter()
CommandInterpreter & m_interpreter
void void AppendError(llvm::StringRef in_string)
void SetStatus(lldb::ReturnStatus status)
std::string GetErrorString(bool with_diagnostics=true)
Return the errors as a string.
void AppendErrorWithFormat(const char *format,...) __attribute__((format(printf
void SetDiagnosticIndent(std::optional< uint16_t > indent)
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:80
bool GetUseColor() const
Definition: Debugger.cpp:421
void RunIOHandlerAsync(const lldb::IOHandlerSP &reader_sp, bool cancel_top_handler=true)
Run the given IO handler and return immediately.
Definition: Debugger.cpp:1224
bool CheckTopIOHandlerTypes(IOHandler::Type top_type, IOHandler::Type second_top_type)
Definition: Debugger.cpp:1194
void SetUnwindOnError(bool unwind=false)
Definition: Target.h:359
void SetExecutionPolicy(ExecutionPolicy policy=eExecutionPolicyAlways)
Definition: Target.h:325
void SetKeepInMemory(bool keep=true)
Definition: Target.h:369
void SetCoerceToId(bool coerce=true)
Definition: Target.h:355
void SetLanguage(lldb::LanguageType language_type)
Definition: Target.h:331
void SetTryAllThreads(bool try_others=true)
Definition: Target.h:392
void SetRetriesWithFixIts(uint64_t number_of_retries)
Definition: Target.h:461
void SetTimeout(const Timeout< std::micro > &timeout)
Definition: Target.h:380
static constexpr ExecutionPolicy default_execution_policy
Definition: Target.h:318
void SetIgnoreBreakpoints(bool ignore=false)
Definition: Target.h:363
void SetUseDynamic(lldb::DynamicValueType dynamic=lldb::eDynamicCanRunTarget)
Definition: Target.h:374
"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:31
A delegate class for use with IOHandler subclasses.
Definition: IOHandler.h:189
lldb::StreamFileSP GetErrorStreamFileSP()
Definition: IOHandler.cpp:107
lldb::StreamFileSP GetOutputStreamFileSP()
Definition: IOHandler.cpp:105
void SetIsDone(bool b)
Definition: IOHandler.h:85
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:273
static const char * GetNameForLanguageType(lldb::LanguageType language)
Definition: Language.cpp:266
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:788
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:319
A command line option parsing protocol class.
Definition: Options.h:58
void NotifyOptionParsingStarting(ExecutionContext *execution_context)
Definition: Options.cpp:68
This base class provides an interface to stack frames.
Definition: StackFrame.h:44
An error handling class.
Definition: Status.h:115
static Status FromErrorStringWithFormat(const char *format,...) __attribute__((format(printf
Definition: Status.cpp:106
static Status FromErrorString(const char *str)
Definition: Status.h:138
bool Fail() const
Test for error condition.
Definition: Status.cpp:270
llvm::StringRef GetString() const
A stream class that can stream formatted output to a file.
Definition: Stream.h:28
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
Definition: Stream.cpp:134
size_t PutCString(llvm::StringRef cstr)
Output a C string to the stream.
Definition: Stream.cpp:65
size_t GetSize() const
Definition: StringList.cpp:74
bool GetEnableNotifyAboutFixIts() const
Definition: Target.cpp:4721
uint64_t GetNumberOfRetriesWithFixits() const
Definition: Target.cpp:4715
bool GetEnableAutoApplyFixIts() const
Definition: Target.cpp:4709
PersistentExpressionState * GetPersistentExpressionStateForLanguage(lldb::LanguageType language)
Definition: Target.cpp:2623
Debugger & GetDebugger()
Definition: Target.h:1080
lldb::ExpressionVariableSP GetPersistentVariable(ConstString name)
Definition: Target.cpp:2858
lldb::REPLSP GetREPL(Status &err, lldb::LanguageType language, const char *repl_options, bool can_create)
Definition: Target.cpp:299
UserExpression * GetUserExpressionForLanguage(llvm::StringRef expr, llvm::StringRef prefix, SourceLanguage language, Expression::ResultType desired_type, const EvaluateExpressionOptions &options, ValueObject *ctx_obj, Status &error)
Definition: Target.cpp:2643
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:2790
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:111
#define LLDB_OPT_SET_2
Definition: lldb-defines.h:112
#define LLDB_OPT_SET_ALL
Definition: lldb-defines.h:110
#define LLDB_OPT_SET_3
Definition: lldb-defines.h:113
A class that represents a running process on the host machine.
const char * toString(AppleArm64ExceptionClass EC)
@ eLanguageRuntimeDescriptionDisplayVerbosityCompact
Definition: SBAddress.h:15
std::shared_ptr< lldb_private::IOHandler > IOHandlerSP
Definition: lldb-forward.h:361
std::shared_ptr< lldb_private::ValueObject > ValueObjectSP
Definition: lldb-forward.h:484
Format
Display format definitions.
@ eFormatVoid
Do not print this.
@ eLanguageTypeUnknown
Unknown or invalid language value.
std::shared_ptr< lldb_private::UserExpression > UserExpressionSP
Definition: lldb-forward.h:332
ExpressionResults
The results of expression evaluation.
@ eExpressionParseError
@ eExpressionSetupError
std::shared_ptr< lldb_private::Process > ProcessSP
Definition: lldb-forward.h:389
@ eReturnStatusFailed
@ eReturnStatusSuccessFinishResult
@ eArgTypeExpression
std::shared_ptr< lldb_private::StreamFile > StreamFileSP
Definition: lldb-forward.h:433
std::shared_ptr< lldb_private::REPL > REPLSP
Definition: lldb-forward.h:401
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)