aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Commands/CommandObjectBreakpointCommand.cpp
diff options
context:
space:
mode:
authorCaroline Tice <ctice@apple.com>2011-06-16 16:27:19 +0000
committerCaroline Tice <ctice@apple.com>2011-06-16 16:27:19 +0000
commitd61c10bc79322b5c51a6facf0de490b1dcf6a809 (patch)
tree73a8aea61d3de2ce8e74caa23e216bc18ce67fa4 /lldb/source/Commands/CommandObjectBreakpointCommand.cpp
parentb5703510595ebf8af37e6e7a479534a01e69fccd (diff)
downloadllvm-d61c10bc79322b5c51a6facf0de490b1dcf6a809.zip
llvm-d61c10bc79322b5c51a6facf0de490b1dcf6a809.tar.gz
llvm-d61c10bc79322b5c51a6facf0de490b1dcf6a809.tar.bz2
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
Diffstat (limited to 'lldb/source/Commands/CommandObjectBreakpointCommand.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectBreakpointCommand.cpp35
1 files changed, 21 insertions, 14 deletions
diff --git a/lldb/source/Commands/CommandObjectBreakpointCommand.cpp b/lldb/source/Commands/CommandObjectBreakpointCommand.cpp
index b452dbc..c68f54c 100644
--- a/lldb/source/Commands/CommandObjectBreakpointCommand.cpp
+++ b/lldb/source/Commands/CommandObjectBreakpointCommand.cpp
@@ -445,25 +445,29 @@ CommandObjectBreakpointCommandAdd::GenerateBreakpointCommandCallback
size_t bytes_len
)
{
- File &out_file = reader.GetDebugger().GetOutputFile();
-
+ StreamSP out_stream = reader.GetDebugger().GetAsyncOutputStream();
+ bool batch_mode = reader.GetDebugger().GetCommandInterpreter().GetBatchCommandMode();
+
switch (notification)
{
case eInputReaderActivate:
- out_file.Printf ("%s\n", g_reader_instructions);
- if (reader.GetPrompt())
- out_file.Printf ("%s", reader.GetPrompt());
- out_file.Flush();
+ if (!batch_mode)
+ {
+ out_stream->Printf ("%s\n", g_reader_instructions);
+ if (reader.GetPrompt())
+ out_stream->Printf ("%s", reader.GetPrompt());
+ out_stream->Flush();
+ }
break;
case eInputReaderDeactivate:
break;
case eInputReaderReactivate:
- if (reader.GetPrompt())
+ if (reader.GetPrompt() && !batch_mode)
{
- out_file.Printf ("%s", reader.GetPrompt());
- out_file.Flush();
+ out_stream->Printf ("%s", reader.GetPrompt());
+ out_stream->Flush();
}
break;
@@ -481,10 +485,10 @@ CommandObjectBreakpointCommandAdd::GenerateBreakpointCommandCallback
((BreakpointOptions::CommandData *)bp_options_baton->m_data)->user_source.AppendString (bytes, bytes_len);
}
}
- if (!reader.IsDone() && reader.GetPrompt())
+ if (!reader.IsDone() && reader.GetPrompt() && !batch_mode)
{
- out_file.Printf ("%s", reader.GetPrompt());
- out_file.Flush();
+ out_stream->Printf ("%s", reader.GetPrompt());
+ out_stream->Flush();
}
break;
@@ -502,8 +506,11 @@ CommandObjectBreakpointCommandAdd::GenerateBreakpointCommandCallback
((BreakpointOptions::CommandData *) bp_options_baton->m_data)->script_source.Clear();
}
}
- out_file.Printf ("Warning: No command attached to breakpoint.\n");
- out_file.Flush();
+ if (!batch_mode)
+ {
+ out_stream->Printf ("Warning: No command attached to breakpoint.\n");
+ out_stream->Flush();
+ }
}
break;