From d61c10bc79322b5c51a6facf0de490b1dcf6a809 Mon Sep 17 00:00:00 2001 From: Caroline Tice Date: Thu, 16 Jun 2011 16:27:19 +0000 Subject: Add 'batch_mode' to CommandInterpreter. Modify InputReaders to not write output (prompts, instructions,etc.) if the CommandInterpreter is in batch_mode. Also, finish updating InputReaders to write to the asynchronous stream, rather than using the Debugger's output file directly. llvm-svn: 133162 --- lldb/source/Commands/CommandObjectExpression.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lldb/source/Commands/CommandObjectExpression.cpp') diff --git a/lldb/source/Commands/CommandObjectExpression.cpp b/lldb/source/Commands/CommandObjectExpression.cpp index 9f2e79e1a67..7d1af333d84 100644 --- a/lldb/source/Commands/CommandObjectExpression.cpp +++ b/lldb/source/Commands/CommandObjectExpression.cpp @@ -191,10 +191,12 @@ CommandObjectExpression::MultiLineExpressionCallback ) { CommandObjectExpression *cmd_object_expr = (CommandObjectExpression *) baton; - + bool batch_mode = reader.GetDebugger().GetCommandInterpreter().GetBatchCommandMode(); + switch (notification) { case eInputReaderActivate: + if (!batch_mode) { StreamSP out_stream = reader.GetDebugger().GetAsyncOutputStream(); out_stream->Printf("%s\n", "Enter expressions, then terminate with an empty line to evaluate:"); @@ -224,6 +226,7 @@ CommandObjectExpression::MultiLineExpressionCallback case eInputReaderInterrupt: cmd_object_expr->m_expr_lines.clear(); reader.SetIsDone (true); + if (!batch_mode) { StreamSP out_stream = reader.GetDebugger().GetAsyncOutputStream(); out_stream->Printf("%s\n", "Expression evaluation cancelled."); -- cgit v1.2.3