Index: lldb/packages/Python/lldbsuite/test/commands/expression/static-initializers/TestStaticInitializers.py =================================================================== --- lldb/packages/Python/lldbsuite/test/commands/expression/static-initializers/TestStaticInitializers.py +++ lldb/packages/Python/lldbsuite/test/commands/expression/static-initializers/TestStaticInitializers.py @@ -26,6 +26,5 @@ lldbutil.run_to_source_breakpoint(self, '// break here', lldb.SBFileSpec("main.cpp", False)) - # FIXME: This error message is not even remotely helpful. self.expect("expr -p -- struct Foo2 { Foo2() { do_abort(); } }; Foo2 f;", error=True, - substrs=["error: couldn't run static initializers: couldn't run static initializer:"]) + substrs=["error: couldn't run static initializers:\nerror: Execution interrupted: "]) Index: lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp =================================================================== --- lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp +++ lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp @@ -1378,8 +1378,10 @@ exe_ctx, call_static_initializer, options, execution_errors); if (results != lldb::eExpressionCompleted) { - err.SetErrorStringWithFormat("couldn't run static initializer: %s", - execution_errors.GetString().c_str()); + if (execution_errors.Diagnostics().empty()) + err.SetErrorStringWithFormatv("ExpressionResults: {0}", results); + else + err.SetErrorStringWithFormatv("{0}", execution_errors.GetString()); return err; } } Index: lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp =================================================================== --- lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp +++ lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp @@ -658,7 +658,7 @@ const char *error_cstr = static_init_error.AsCString(); if (error_cstr && error_cstr[0]) diagnostic_manager.Printf(eDiagnosticSeverityError, - "couldn't run static initializers: %s\n", + "couldn't run static initializers:\n%s\n", error_cstr); else diagnostic_manager.PutString(eDiagnosticSeverityError, Index: lldb/source/Target/Process.cpp =================================================================== --- lldb/source/Target/Process.cpp +++ lldb/source/Target/Process.cpp @@ -5304,13 +5304,14 @@ } } while (false); + std::string error = s.GetString(); if (event_explanation) - LLDB_LOGF(log, - "Process::RunThreadPlan(): execution interrupted: %s %s", - s.GetData(), event_explanation); - else - LLDB_LOGF(log, "Process::RunThreadPlan(): execution interrupted: %s", - s.GetData()); + error += " " + std::string(event_explanation); + + diagnostic_manager.PutString(eDiagnosticSeverityError, + "Execution interrupted: " + error); + LLDB_LOGF(log, "Process::RunThreadPlan(): execution interrupted: %s", + error.c_str()); } if (should_unwind) {