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.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@133162 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Commands/CommandObjectBreakpointCommand.cpp b/source/Commands/CommandObjectBreakpointCommand.cpp
index b452dbc..c68f54c 100644
--- a/source/Commands/CommandObjectBreakpointCommand.cpp
+++ b/source/Commands/CommandObjectBreakpointCommand.cpp
@@ -445,25 +445,29 @@
     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 @@
                     ((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 @@
                     ((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;