Fixed CommandReturnObject::SetImmediateErrorFile() to set the correct stream.

Modifed lldb_private::Process to be able to handle connecting to a remote 
target that isn't running a process. This leaves lldb_private::Process in the
eStateConnected state from which we can then do an attach or launch.

Modified ProcessGDBRemote to be able to set stdin, stdout, stderr, working
dir, disable ASLR and a few other settings down by using new GDB remote 
packets. This allows us to keep all of our current launch flags and settings
intact and still be able to communicate them over to the remote GDB server.
Previously these were being sent as arguments to the debugserver binary that
we were spawning. Also modified ProcessGDBRemote to handle losing connection
to the remote GDB server and always exit immediately. We do this by watching
the lldb_private::Communication event bit for the read thread exiting in the
ProcessGDBRemote async thread.

Added support for many of the new 'Q' packets for setting stdin, stdout,
stderr, working dir and disable ASLR to the GDBRemoteCommunication class for
easy accesss.

Modified debugserver for all of the new 'Q' packets and also made it so that
debugserver always exists if it loses connection with the remote debugger.




git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@126444 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h b/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h
index 1499ba9..8d24f2a 100644
--- a/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h
+++ b/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h
@@ -196,6 +196,49 @@
                 StringExtractorGDBRemote& response);
 
 
+    //------------------------------------------------------------------
+    /// Sets the path to use for stdin/out/err for a process
+    /// that will be launched with the 'A' packet.
+    ///
+    /// @param[in] path
+    ///     The path to use for stdin/out/err
+    ///
+    /// @return
+    ///     Zero if the for success, or an error code for failure.
+    //------------------------------------------------------------------
+    int
+    SetSTDIN (char const *path);
+    int
+    SetSTDOUT (char const *path);
+    int
+    SetSTDERR (char const *path);
+
+    //------------------------------------------------------------------
+    /// Sets the disable ASLR flag to \a enable for a process that will 
+    /// be launched with the 'A' packet.
+    ///
+    /// @param[in] enable
+    ///     A boolean value indicating wether to disable ASLR or not.
+    ///
+    /// @return
+    ///     Zero if the for success, or an error code for failure.
+    //------------------------------------------------------------------
+    int
+    SetDisableASLR (bool enable);
+
+    //------------------------------------------------------------------
+    /// Sets the working directory to \a path for a process that will 
+    /// be launched with the 'A' packet.
+    ///
+    /// @param[in] path
+    ///     The path to a directory to use when launching our processs
+    ///
+    /// @return
+    ///     Zero if the for success, or an error code for failure.
+    //------------------------------------------------------------------
+    int
+    SetWorkingDir (char const *path);
+
     lldb::addr_t
     AllocateMemory (size_t size, uint32_t permissions, uint32_t timeout_seconds);