diff options
author | Ewan Crawford <ewan@codeplay.com> | 2015-06-16 15:50:18 +0000 |
---|---|---|
committer | Ewan Crawford <ewan@codeplay.com> | 2015-06-16 15:50:18 +0000 |
commit | fab40d3911d3052085220c616820e9761ed9e32f (patch) | |
tree | 16a95e44cfad8e587dbcabd51b5029a7cbf17445 /lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp | |
parent | c81f450f1a71c2630fbb42671111507e811c753c (diff) | |
download | bcm5719-llvm-fab40d3911d3052085220c616820e9761ed9e32f.tar.gz bcm5719-llvm-fab40d3911d3052085220c616820e9761ed9e32f.zip |
Add Read Thread to GDBRemoteCommunication
In order to support asynchronous notifications for non-stop mode this patch adds a packet read thread. This is done by implementing AppendBytesToCache() from the communications class, which continually reads packets into a packet queue. To initialize this thread StartReadThread() must be called by the client, so since llgs and platform tools use the GBDRemoteCommunicatos code they must also call this function as well as ProcessGDBRemote.
When the read thread detects an async notify packet it broadcasts this event, where the matching listener will be added in the next non-stop patch.
Packets are now accessed by calling ReadPacket() which pops a packet from the queue, instead of using WaitForPacketWithTimeoutMicroSecondsNoLock()
Reviewers: vharron, clayborg
Subscribers: lldb-commits, labath, ted, domipheus, deepak2427
Differential Revision: http://reviews.llvm.org/D10085
llvm-svn: 239824
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp')
-rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp index 71001631ad5..355f052b786 100644 --- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp @@ -1151,6 +1151,12 @@ ProcessGDBRemote::ConnectToDebugserver (const char *connect_url) return error; } + + // Start the communications read thread so all incoming data can be + // parsed into packets and queued as they arrive. + if (GetTarget().GetNonStopModeEnabled()) + m_gdb_comm.StartReadThread(); + // We always seem to be able to open a connection to a local port // so we need to make sure we can then send data to it. If we can't // then we aren't actually connected to anything, so try and do the |