diff options
Diffstat (limited to 'lldb')
-rw-r--r-- | lldb/include/lldb/API/SBCommunication.h | 8 | ||||
-rw-r--r-- | lldb/include/lldb/Core/Communication.h | 16 | ||||
-rw-r--r-- | lldb/source/API/SBCommunication.cpp | 19 | ||||
-rw-r--r-- | lldb/source/Core/Communication.cpp | 10 | ||||
-rw-r--r-- | lldb/source/Core/Debugger.cpp | 3 | ||||
-rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp | 2 | ||||
-rw-r--r-- | lldb/source/Target/Process.cpp | 2 | ||||
-rw-r--r-- | lldb/tools/driver/Driver.cpp | 3 |
8 files changed, 45 insertions, 18 deletions
diff --git a/lldb/include/lldb/API/SBCommunication.h b/lldb/include/lldb/API/SBCommunication.h index 7533cf6e2f2..9763015c9c1 100644 --- a/lldb/include/lldb/API/SBCommunication.h +++ b/lldb/include/lldb/API/SBCommunication.h @@ -30,7 +30,7 @@ public: 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 @@ public: bool IsConnected () const; + bool + GetCloseOnEOF (); + + void + SetCloseOnEOF (bool b); + size_t Read (void *dst, size_t dst_len, diff --git a/lldb/include/lldb/Core/Communication.h b/lldb/include/lldb/Core/Communication.h index f841bae5713..e54d819f063 100644 --- a/lldb/include/lldb/Core/Communication.h +++ b/lldb/include/lldb/Core/Communication.h @@ -109,7 +109,7 @@ public: /// 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 @@ public: 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. diff --git a/lldb/source/API/SBCommunication.cpp b/lldb/source/API/SBCommunication.cpp index 6aa1e244d3c..9db6c444902 100644 --- a/lldb/source/API/SBCommunication.cpp +++ b/lldb/source/API/SBCommunication.cpp @@ -24,8 +24,8 @@ SBCommunication::SBCommunication() : { } -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 @@ SBCommunication::~SBCommunication() 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 () { diff --git a/lldb/source/Core/Communication.cpp b/lldb/source/Core/Communication.cpp index 9258a0cd403..f9a4be1a6db 100644 --- a/lldb/source/Core/Communication.cpp +++ b/lldb/source/Core/Communication.cpp @@ -25,7 +25,7 @@ using namespace lldb_private; //---------------------------------------------------------------------- // 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 @@ Communication::Communication(const char *name, bool close_on_eof) : 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 @@ Communication::ReadFromConnection (void *dst, size_t dst_len, ConnectionStatus & } bool -Communication::CloseOnEOF () -{ - return m_close_on_eof; -} - -bool Communication::ReadThreadIsRunning () { return m_read_thread != LLDB_INVALID_HOST_THREAD; diff --git a/lldb/source/Core/Debugger.cpp b/lldb/source/Core/Debugger.cpp index c96cbdff41b..179e4607c57 100644 --- a/lldb/source/Core/Debugger.cpp +++ b/lldb/source/Core/Debugger.cpp @@ -166,7 +166,7 @@ Debugger::FindTargetWithProcessID (lldb::pid_t pid) 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 @@ Debugger::Debugger () : m_input_readers (), m_input_reader_data () { + m_input_comm.SetCloseOnEOF(false); m_command_interpreter_ap->Initialize (); } diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp index 394b55231a8..d19e19802da 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp @@ -32,7 +32,7 @@ using namespace lldb_private; // 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), diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp index 5b87c528e31..4c9a799fe83 100644 --- a/lldb/source/Target/Process.cpp +++ b/lldb/source/Target/Process.cpp @@ -96,7 +96,7 @@ Process::Process(Target &target, Listener &listener) : 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 () { diff --git a/lldb/tools/driver/Driver.cpp b/lldb/tools/driver/Driver.cpp index abd51a56644..0db56737703 100644 --- a/lldb/tools/driver/Driver.cpp +++ b/lldb/tools/driver/Driver.cpp @@ -1178,7 +1178,8 @@ Driver::MainLoop () // 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); |