Skip to content

Commit ed32d85

Browse files
committed
[lldb] Use async output & error stream for EvaluateExpression
Similar to llvm#126821, in support of llvm#126630.
1 parent 8fff0c1 commit ed32d85

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
@@ -500,19 +500,17 @@ bool CommandObjectExpression::EvaluateExpression(llvm::StringRef expr,
500500
void CommandObjectExpression::IOHandlerInputComplete(IOHandler &io_handler,
501501
std::string &line) {
502502
io_handler.SetIsDone(true);
503-
StreamFileSP output_sp = io_handler.GetOutputStreamFileSP();
504-
StreamFileSP error_sp = io_handler.GetErrorStreamFileSP();
503+
StreamSP output_stream =
504+
GetCommandInterpreter().GetDebugger().GetAsyncOutputStream();
505+
StreamSP error_stream =
506+
GetCommandInterpreter().GetDebugger().GetAsyncErrorStream();
505507

506508
CommandReturnObject return_obj(
507509
GetCommandInterpreter().GetDebugger().GetUseColor());
508-
EvaluateExpression(line.c_str(), *output_sp, *error_sp, return_obj);
510+
EvaluateExpression(line.c_str(), *output_stream, *error_stream, return_obj);
509511

510-
if (output_sp)
511-
output_sp->Flush();
512-
if (error_sp) {
513-
*error_sp << return_obj.GetErrorString();
514-
error_sp->Flush();
515-
}
512+
output_stream->Flush();
513+
*error_stream << return_obj.GetErrorString();
516514
}
517515

518516
bool CommandObjectExpression::IOHandlerIsInputComplete(IOHandler &io_handler,

0 commit comments

Comments
 (0)