================ @@ -485,35 +485,8 @@ bool CommandObjectExpression::EvaluateExpression(llvm::StringRef expr, result.SetStatus(eReturnStatusSuccessFinishResult); } else { - // Retrieve the diagnostics. - std::vector<DiagnosticDetail> details; - llvm::consumeError(llvm::handleErrors( - result_valobj_sp->GetError().ToError(), - [&](DiagnosticError &error) { details = error.GetDetails(); })); - // Find the position of the expression in the command. - std::optional<uint16_t> expr_pos; - size_t nchar = m_original_command.find(expr); - if (nchar != std::string::npos) - expr_pos = nchar + GetDebugger().GetPrompt().size(); - - if (!details.empty()) { - bool show_inline = - GetDebugger().GetShowInlineDiagnostics() && !expr.contains('\n'); - RenderDiagnosticDetails(error_stream, expr_pos, show_inline, details); - } else { - const char *error_cstr = result_valobj_sp->GetError().AsCString(); - llvm::StringRef error(error_cstr); - if (!error.empty()) { - if (!error.starts_with("error:")) - error_stream << "error: "; - error_stream << error; - if (!error.ends_with('\n')) - error_stream.EOL(); - } else { - error_stream << "error: unknown error\n"; - } - } result.SetStatus(eReturnStatusFailed); + result.SetError(result_valobj_sp->GetError().ToError()); ---------------- medismailben wrote:
Nice! https://github.com/llvm/llvm-project/pull/112109 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits