diff options
-rw-r--r-- | lldb/source/Commands/CommandObjectExpression.cpp | 17 | ||||
-rw-r--r-- | lldb/source/Expression/ClangUserExpression.cpp | 2 |
2 files changed, 17 insertions, 2 deletions
diff --git a/lldb/source/Commands/CommandObjectExpression.cpp b/lldb/source/Commands/CommandObjectExpression.cpp index 7d1af333d84..57dd7c70bb3 100644 --- a/lldb/source/Commands/CommandObjectExpression.cpp +++ b/lldb/source/Commands/CommandObjectExpression.cpp @@ -335,7 +335,22 @@ CommandObjectExpression::EvaluateExpression } else { - error_stream->PutCString(result_valobj_sp->GetError().AsCString()); + const char *error_cstr = result_valobj_sp->GetError().AsCString(); + if (error_cstr && error_cstr[0]) + { + int error_cstr_len = strlen (error_cstr); + const bool ends_with_newline = error_cstr[error_cstr_len - 1] == '\n'; + if (strstr(error_cstr, "error:") != error_cstr) + error_stream->PutCString ("error: "); + error_stream->Write(error_cstr, error_cstr_len); + if (!ends_with_newline) + error_stream->EOL(); + } + else + { + error_stream->PutCString ("error: unknown error\n"); + } + if (result) result->SetStatus (eReturnStatusFailed); } diff --git a/lldb/source/Expression/ClangUserExpression.cpp b/lldb/source/Expression/ClangUserExpression.cpp index 3c8c3434293..0df6a5b63b7 100644 --- a/lldb/source/Expression/ClangUserExpression.cpp +++ b/lldb/source/Expression/ClangUserExpression.cpp @@ -599,7 +599,7 @@ ClangUserExpression::Evaluate (ExecutionContext &exe_ctx, if (exe_ctx.process == NULL || exe_ctx.process->GetState() != lldb::eStateStopped) { - error.SetErrorString ("Must have a live but stopped process to evaluate expressions."); + error.SetErrorString ("must have a stopped process to evaluate expressions."); result_valobj_sp = ValueObjectConstResult::Create (NULL, error); return eExecutionSetupError; |