From ed32d85d31999756602a7d5c4647cb6771d8f857 Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Fri, 14 Feb 2025 22:01:29 -0800 Subject: [lldb] Use async output & error stream for EvaluateExpression Similar to #126821, in support of #126630. --- lldb/source/Commands/CommandObjectExpression.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'lldb/source/Commands/CommandObjectExpression.cpp') diff --git a/lldb/source/Commands/CommandObjectExpression.cpp b/lldb/source/Commands/CommandObjectExpression.cpp index 13491b5..7e26381 100644 --- a/lldb/source/Commands/CommandObjectExpression.cpp +++ b/lldb/source/Commands/CommandObjectExpression.cpp @@ -500,19 +500,17 @@ bool CommandObjectExpression::EvaluateExpression(llvm::StringRef expr, void CommandObjectExpression::IOHandlerInputComplete(IOHandler &io_handler, std::string &line) { io_handler.SetIsDone(true); - StreamFileSP output_sp = io_handler.GetOutputStreamFileSP(); - StreamFileSP error_sp = io_handler.GetErrorStreamFileSP(); + StreamSP output_stream = + GetCommandInterpreter().GetDebugger().GetAsyncOutputStream(); + StreamSP error_stream = + GetCommandInterpreter().GetDebugger().GetAsyncErrorStream(); CommandReturnObject return_obj( GetCommandInterpreter().GetDebugger().GetUseColor()); - EvaluateExpression(line.c_str(), *output_sp, *error_sp, return_obj); + EvaluateExpression(line.c_str(), *output_stream, *error_stream, return_obj); - if (output_sp) - output_sp->Flush(); - if (error_sp) { - *error_sp << return_obj.GetErrorString(); - error_sp->Flush(); - } + output_stream->Flush(); + *error_stream << return_obj.GetErrorString(); } bool CommandObjectExpression::IOHandlerIsInputComplete(IOHandler &io_handler, -- cgit v1.1