diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2023-12-09 13:28:42 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2023-12-09 13:28:42 +0000 |
| commit | b1c73532ee8997fe5dfbeb7d223027bdf99758a0 (patch) | |
| tree | 7d6e51c294ab6719475d660217aa0c0ad0526292 /lldb/source/Commands/CommandObjectExpression.cpp | |
| parent | 7fa27ce4a07f19b07799a767fc29416f3b625afb (diff) | |
Diffstat (limited to 'lldb/source/Commands/CommandObjectExpression.cpp')
| -rw-r--r-- | lldb/source/Commands/CommandObjectExpression.cpp | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/lldb/source/Commands/CommandObjectExpression.cpp b/lldb/source/Commands/CommandObjectExpression.cpp index e7e6e3820b99..3a2dc11e1e71 100644 --- a/lldb/source/Commands/CommandObjectExpression.cpp +++ b/lldb/source/Commands/CommandObjectExpression.cpp @@ -439,11 +439,11 @@ bool CommandObjectExpression::EvaluateExpression(llvm::StringRef expr, ExpressionResults success = target.EvaluateExpression( expr, frame, result_valobj_sp, eval_options, &m_fixed_expression); - // We only tell you about the FixIt if we applied it. The compiler errors - // will suggest the FixIt if it parsed. + // Only mention Fix-Its if the expression evaluator applied them. + // Compiler errors refer to the final expression after applying Fix-It(s). if (!m_fixed_expression.empty() && target.GetEnableNotifyAboutFixIts()) { - error_stream.Printf(" Fix-it applied, fixed expression was: \n %s\n", - m_fixed_expression.c_str()); + error_stream << " Evaluated this expression after applying Fix-It(s):\n"; + error_stream << " " << m_fixed_expression << "\n"; } if (result_valobj_sp) { @@ -594,7 +594,7 @@ GetExprOptions(ExecutionContext &ctx, return expr_options; } -bool CommandObjectExpression::DoExecute(llvm::StringRef command, +void CommandObjectExpression::DoExecute(llvm::StringRef command, CommandReturnObject &result) { m_fixed_expression.clear(); auto exe_ctx = GetCommandInterpreter().GetExecutionContext(); @@ -602,7 +602,7 @@ bool CommandObjectExpression::DoExecute(llvm::StringRef command, if (command.empty()) { GetMultilineExpression(); - return result.Succeeded(); + return; } OptionsWithRaw args(command); @@ -610,7 +610,7 @@ bool CommandObjectExpression::DoExecute(llvm::StringRef command, if (args.HasArgs()) { if (!ParseOptionsAndNotify(args.GetArgs(), result, m_option_group, exe_ctx)) - return false; + return; if (m_repl_option.GetOptionValue().GetCurrentValue()) { Target &target = GetSelectedOrDummyTarget(); @@ -642,7 +642,7 @@ bool CommandObjectExpression::DoExecute(llvm::StringRef command, nullptr, true); if (!repl_error.Success()) { result.SetError(repl_error); - return result.Succeeded(); + return; } } @@ -662,14 +662,14 @@ bool CommandObjectExpression::DoExecute(llvm::StringRef command, "Couldn't create a REPL for %s", Language::GetNameForLanguageType(m_command_options.language)); result.SetError(repl_error); - return result.Succeeded(); + return; } } } // No expression following options else if (expr.empty()) { GetMultilineExpression(); - return result.Succeeded(); + return; } } @@ -691,8 +691,7 @@ bool CommandObjectExpression::DoExecute(llvm::StringRef command, fixed_command.append(m_fixed_expression); history.AppendString(fixed_command); } - return true; + return; } result.SetStatus(eReturnStatusFailed); - return false; } |
