Make the driver listen for asynchronous output, rather than
the IOChannel, so that it can be written out even while the
IOChannel is collecting user input.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@130789 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/driver/Driver.cpp b/tools/driver/Driver.cpp
index 5107708..c3d4015 100644
--- a/tools/driver/Driver.cpp
+++ b/tools/driver/Driver.cpp
@@ -1124,7 +1124,9 @@
             bool iochannel_thread_exited = false;
 
             listener.StartListeningForEvents (sb_interpreter.GetBroadcaster(),
-                                              SBCommandInterpreter::eBroadcastBitQuitCommandReceived);
+                                              SBCommandInterpreter::eBroadcastBitQuitCommandReceived |
+                                              SBCommandInterpreter::eBroadcastBitAsynchronousOutputData |
+                                              SBCommandInterpreter::eBroadcastBitAsynchronousErrorData);
 
             // Before we handle any options from the command line, we parse the
             // .lldbinit file in the user's home directory.
@@ -1234,6 +1236,16 @@
                         {
                             if (event_type & SBCommandInterpreter::eBroadcastBitQuitCommandReceived)
                                 done = true;
+                            else if (event_type & SBCommandInterpreter::eBroadcastBitAsynchronousErrorData)
+                            {
+                                const char *data = SBEvent::GetCStringFromEvent (event);
+                                m_io_channel_ap->ErrWrite (data, strlen(data), ASYNC);
+                            }
+                            else if (event_type & SBCommandInterpreter::eBroadcastBitAsynchronousOutputData)
+                            {
+                                const char *data = SBEvent::GetCStringFromEvent (event);
+                                m_io_channel_ap->OutWrite (data, strlen(data), ASYNC);
+                            }
                         }
                     }
                 }