Add Read Thread to GDBRemoteCommunication
authorEwan Crawford <ewan@codeplay.com>
Tue, 16 Jun 2015 15:50:18 +0000 (15:50 +0000)
committerEwan Crawford <ewan@codeplay.com>
Tue, 16 Jun 2015 15:50:18 +0000 (15:50 +0000)
commitfab40d3911d3052085220c616820e9761ed9e32f
tree16a95e44cfad8e587dbcabd51b5029a7cbf17445
parentc81f450f1a71c2630fbb42671111507e811c753c
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
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp