Skip to content

Commit a926ee7

Browse files
committed
[lldb] Use async output & error stream for EvaluateExpression
Similar to llvm#126821, in support of llvm#126630. (cherry picked from commit ed32d85)
1 parent 6c2abc5 commit a926ee7

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

lldb/source/Commands/CommandObjectExpression.cpp

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -526,19 +526,17 @@ bool CommandObjectExpression::EvaluateExpression(llvm::StringRef expr,
526526
void CommandObjectExpression::IOHandlerInputComplete(IOHandler &io_handler,
527527
std::string &line) {
528528
io_handler.SetIsDone(true);
529-
StreamFileSP output_sp = io_handler.GetOutputStreamFileSP();
530-
StreamFileSP error_sp = io_handler.GetErrorStreamFileSP();
529+
StreamSP output_stream =
530+
GetCommandInterpreter().GetDebugger().GetAsyncOutputStream();
531+
StreamSP error_stream =
532+
GetCommandInterpreter().GetDebugger().GetAsyncErrorStream();
531533

532534
CommandReturnObject return_obj(
533535
GetCommandInterpreter().GetDebugger().GetUseColor());
534-
EvaluateExpression(line.c_str(), *output_sp, *error_sp, return_obj);
536+
EvaluateExpression(line.c_str(), *output_stream, *error_stream, return_obj);
535537

536-
if (output_sp)
537-
output_sp->Flush();
538-
if (error_sp) {
539-
*error_sp << return_obj.GetErrorString();
540-
error_sp->Flush();
541-
}
538+
output_stream->Flush();
539+
*error_stream << return_obj.GetErrorString();
542540
}
543541

544542
bool CommandObjectExpression::IOHandlerIsInputComplete(IOHandler &io_handler,

0 commit comments

Comments
 (0)