aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Commands/CommandObjectExpression.cpp
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2025-02-14 22:01:29 -0800
committerJonas Devlieghere <jonas@devlieghere.com>2025-02-14 22:11:03 -0800
commited32d85d31999756602a7d5c4647cb6771d8f857 (patch)
treea66b61a7586117fb7597e0c91f307ff22d635b0e /lldb/source/Commands/CommandObjectExpression.cpp
parent8fff0c181f26a5e8b2344c061ebf2559118b1160 (diff)
downloadllvm-ed32d85d31999756602a7d5c4647cb6771d8f857.zip
llvm-ed32d85d31999756602a7d5c4647cb6771d8f857.tar.gz
llvm-ed32d85d31999756602a7d5c4647cb6771d8f857.tar.bz2
[lldb] Use async output & error stream for EvaluateExpression
Similar to #126821, in support of #126630.
Diffstat (limited to 'lldb/source/Commands/CommandObjectExpression.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectExpression.cpp16
1 files changed, 7 insertions, 9 deletions
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,