Index: lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp =================================================================== --- lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp +++ lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp @@ -1323,8 +1323,7 @@ type_system_helper->DeclMap(); // result can be NULL if (decl_map) { - Target *target = exe_ctx.GetTargetPtr(); - auto &error_stream = target->GetDebugger().GetErrorStream(); + StreamString error_stream; IRForTarget ir_for_target(decl_map, m_expr.NeedsVariableResolution(), *execution_unit_sp, error_stream, function_name.AsCString()); @@ -1333,8 +1332,7 @@ ir_for_target.runOnModule(*execution_unit_sp->GetModule()); if (!ir_can_run) { - err.SetErrorString( - "The expression could not be prepared to run in the target"); + err.SetErrorString(error_stream.GetString()); return err; } Index: lldb/test/API/lang/objc/modules-non-objc-target/TestObjCModulesNonObjCTarget.py =================================================================== --- lldb/test/API/lang/objc/modules-non-objc-target/TestObjCModulesNonObjCTarget.py +++ lldb/test/API/lang/objc/modules-non-objc-target/TestObjCModulesNonObjCTarget.py @@ -23,4 +23,4 @@ # be prepared to run in the target but it should at least not crash LLDB. self.expect('expr --lang objc -- [NSString stringWithFormat:@"%d", 1];', error=True, - substrs=["error: The expression could not be prepared to run in the target"]) + substrs=["Rewriting an Objective-C constant string requires CFStringCreateWithBytes"])