[Lldb-commits] [lldb] r120885 - in /lldb/trunk: include/lldb/API/SBCommunication.h include/lldb/Core/Communication.h source/API/SBCommunication.cpp source/Core/Communication.cpp source/Core/Debugger.cpp source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp source/Target/Process.cpp tools/driver/Driver.cpp

Greg Clayton gclayton at apple.com
Fri Dec 3 18:39:47 PST 2010


Author: gclayton
Date: Fri Dec  3 20:39:47 2010
New Revision: 120885

URL: http://llvm.org/viewvc/llvm-project?rev=120885&view=rev
Log:
More reverting of the EOF stuff as the API was changed which we don't want to
do. Closing on EOF is an option that can be set on the 
lldb_private::Communication or the lldb::SBCommunication objects after they
are created. Of course the EOF support isn't hooked up, so they don't do 
anything at the moment, but they are left in so when the code is fixed, it 
will be easy to get working again.


Modified:
    lldb/trunk/include/lldb/API/SBCommunication.h
    lldb/trunk/include/lldb/Core/Communication.h
    lldb/trunk/source/API/SBCommunication.cpp
    lldb/trunk/source/Core/Communication.cpp
    lldb/trunk/source/Core/Debugger.cpp
    lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
    lldb/trunk/source/Target/Process.cpp
    lldb/trunk/tools/driver/Driver.cpp

Modified: lldb/trunk/include/lldb/API/SBCommunication.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBCommunication.h?rev=120885&r1=120884&r2=120885&view=diff
==============================================================================
--- lldb/trunk/include/lldb/API/SBCommunication.h (original)
+++ lldb/trunk/include/lldb/API/SBCommunication.h Fri Dec  3 20:39:47 2010
@@ -30,7 +30,7 @@
     typedef void (*ReadThreadBytesReceived) (void *baton, const void *src, size_t src_len);
 
     SBCommunication ();
-    SBCommunication (const char * broadcaster_name, bool close_on_eof);
+    SBCommunication (const char * broadcaster_name);
    ~SBCommunication ();
 
 
@@ -58,6 +58,12 @@
     bool
     IsConnected () const;
 
+    bool
+    GetCloseOnEOF ();
+
+    void
+    SetCloseOnEOF (bool b);
+
     size_t
     Read (void *dst,
           size_t dst_len,

Modified: lldb/trunk/include/lldb/Core/Communication.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Communication.h?rev=120885&r1=120884&r2=120885&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/Communication.h (original)
+++ lldb/trunk/include/lldb/Core/Communication.h Fri Dec  3 20:39:47 2010
@@ -109,7 +109,7 @@
     ///     broadcaster name can be updated after the connect function
     ///     is called.
     //------------------------------------------------------------------
-    Communication(const char * broadcaster_name, bool close_on_eof);
+    Communication(const char * broadcaster_name);
 
     //------------------------------------------------------------------
     /// Destructor.
@@ -334,14 +334,24 @@
     static const char *
     ConnectionStatusAsCString (lldb::ConnectionStatus status);
 
+    bool
+    GetCloseOnEOF () const
+    { 
+        return m_close_on_eof;
+    }
+
+    void
+    SetCloseOnEOF (bool b)
+    { 
+        m_close_on_eof = b;
+    }
+
 private:
     //------------------------------------------------------------------
     // For Communication only
     //------------------------------------------------------------------
     DISALLOW_COPY_AND_ASSIGN (Communication);
 
-    bool
-    CloseOnEOF ();
 
 protected:
     std::auto_ptr<Connection> m_connection_ap; ///< The connection that is current in use by this communications class.

Modified: lldb/trunk/source/API/SBCommunication.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBCommunication.cpp?rev=120885&r1=120884&r2=120885&view=diff
==============================================================================
--- lldb/trunk/source/API/SBCommunication.cpp (original)
+++ lldb/trunk/source/API/SBCommunication.cpp Fri Dec  3 20:39:47 2010
@@ -24,8 +24,8 @@
 {
 }
 
-SBCommunication::SBCommunication(const char * broadcaster_name, bool close_on_eof) :
-    m_opaque (new Communication (broadcaster_name, close_on_eof)),
+SBCommunication::SBCommunication(const char * broadcaster_name) :
+    m_opaque (new Communication (broadcaster_name)),
     m_opaque_owned (true)
 {
     LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
@@ -43,6 +43,21 @@
     m_opaque_owned = false;
 }
 
+bool
+SBCommunication::GetCloseOnEOF ()
+{
+    if (m_opaque)
+        return m_opaque->GetCloseOnEOF ();
+    return false;
+}
+
+void
+SBCommunication::SetCloseOnEOF (bool b)
+{
+    if (m_opaque)
+        m_opaque->SetCloseOnEOF (b);
+}
+
 ConnectionStatus
 SBCommunication::CheckIfBytesAvailable ()
 {

Modified: lldb/trunk/source/Core/Communication.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Communication.cpp?rev=120885&r1=120884&r2=120885&view=diff
==============================================================================
--- lldb/trunk/source/Core/Communication.cpp (original)
+++ lldb/trunk/source/Core/Communication.cpp Fri Dec  3 20:39:47 2010
@@ -25,7 +25,7 @@
 //----------------------------------------------------------------------
 // Constructor
 //----------------------------------------------------------------------
-Communication::Communication(const char *name, bool close_on_eof) :
+Communication::Communication(const char *name) :
     Broadcaster (name),
     m_connection_ap (),
     m_read_thread (LLDB_INVALID_HOST_THREAD),
@@ -34,7 +34,7 @@
     m_bytes_mutex (Mutex::eMutexTypeRecursive),
     m_callback (NULL),
     m_callback_baton (NULL),
-    m_close_on_eof (close_on_eof)
+    m_close_on_eof (true)
 
 {
     lldb_private::LogIfAnyCategoriesSet (LIBLLDB_LOG_OBJECT | LIBLLDB_LOG_COMMUNICATION,
@@ -291,12 +291,6 @@
 }
 
 bool
-Communication::CloseOnEOF ()
-{
-    return m_close_on_eof;
-}
-
-bool
 Communication::ReadThreadIsRunning ()
 {
     return m_read_thread != LLDB_INVALID_HOST_THREAD;

Modified: lldb/trunk/source/Core/Debugger.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Debugger.cpp?rev=120885&r1=120884&r2=120885&view=diff
==============================================================================
--- lldb/trunk/source/Core/Debugger.cpp (original)
+++ lldb/trunk/source/Core/Debugger.cpp Fri Dec  3 20:39:47 2010
@@ -166,7 +166,7 @@
 Debugger::Debugger () :
     UserID (g_unique_id++),
     DebuggerInstanceSettings (*GetSettingsController()),
-    m_input_comm("debugger.input", false),
+    m_input_comm("debugger.input"),
     m_input_file (),
     m_output_file (),
     m_error_file (),
@@ -178,6 +178,7 @@
     m_input_readers (),
     m_input_reader_data ()
 {
+    m_input_comm.SetCloseOnEOF(false);
     m_command_interpreter_ap->Initialize ();
 }
 

Modified: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp?rev=120885&r1=120884&r2=120885&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp Fri Dec  3 20:39:47 2010
@@ -32,7 +32,7 @@
 // GDBRemoteCommunication constructor
 //----------------------------------------------------------------------
 GDBRemoteCommunication::GDBRemoteCommunication() :
-    Communication("gdb-remote.packets", true),
+    Communication("gdb-remote.packets"),
     m_send_acks (true),
     m_rx_packet_listener ("gdbremote.rx_packet"),
     m_sequence_mutex (Mutex::eMutexTypeRecursive),

Modified: lldb/trunk/source/Target/Process.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Process.cpp?rev=120885&r1=120884&r2=120885&view=diff
==============================================================================
--- lldb/trunk/source/Target/Process.cpp (original)
+++ lldb/trunk/source/Target/Process.cpp Fri Dec  3 20:39:47 2010
@@ -96,7 +96,7 @@
     m_addr_byte_size (0),
     m_abi_sp (),
     m_process_input_reader (),
-    m_stdio_communication ("lldb.process.stdio", true),
+    m_stdio_communication ("lldb.process.stdio"),
     m_stdio_communication_mutex (Mutex::eMutexTypeRecursive),
     m_stdout_data ()
 {

Modified: lldb/trunk/tools/driver/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/driver/Driver.cpp?rev=120885&r1=120884&r2=120885&view=diff
==============================================================================
--- lldb/trunk/tools/driver/Driver.cpp (original)
+++ lldb/trunk/tools/driver/Driver.cpp Fri Dec  3 20:39:47 2010
@@ -1178,7 +1178,8 @@
     // However, you don't need to do anything with the characters, since editline will dump these
     // unconsumed characters after printing the prompt again in el_gets.
 
-    SBCommunication master_out_comm("driver.editline", false);
+    SBCommunication master_out_comm("driver.editline");
+    master_out_comm.SetCloseOnEOF (false);
     master_out_comm.AdoptFileDesriptor(m_editline_pty.GetMasterFileDescriptor(), false);
     master_out_comm.SetReadThreadBytesReceivedCallback(Driver::MasterThreadBytesReceived, this);
 





More information about the lldb-commits mailing list