diff options
author | Todd Fiala <todd.fiala@gmail.com> | 2016-09-10 00:06:29 +0000 |
---|---|---|
committer | Todd Fiala <todd.fiala@gmail.com> | 2016-09-10 00:06:29 +0000 |
commit | fcdb1af655a80b4f1b4f17929235613216ebaaf5 (patch) | |
tree | e1fd91a5b83d1e68fb2821b7021d91daf372eb58 /lldb/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.h | |
parent | 99b555709e69348af3e23be8e8ed6686264998a5 (diff) | |
download | llvm-fcdb1af655a80b4f1b4f17929235613216ebaaf5.zip llvm-fcdb1af655a80b4f1b4f17929235613216ebaaf5.tar.gz llvm-fcdb1af655a80b4f1b4f17929235613216ebaaf5.tar.bz2 |
async structured data packet handling improvements
This change does the following:
* Changes the signature for the continuation delegate method that handles
async structured data from accepting an already-parsed structured data
element to taking just the packet contents.
* Moves the conversion of the JSON-async: packet contents from
GDBRemoteClientBase to the continuation delegate method.
* Adds a new unit test for verifying that the $JSON-asyc: packets get
decoded and that the decoded packets get forwarded on to the delegate
for further processing. Thanks to Pavel for making that whole section of
code easily unit testable!
* Tightens up the packet verification on reception of a $JSON-async:
packet contents. The code prior to this change is susceptible to a
segfault if a packet is carefully crafted that starts with $J but
has a total length shorter than the length of "$JSON-async:".
Reviewers: labath, clayborg, zturner
Differential Revision: https://reviews.llvm.org/D23884
llvm-svn: 281121
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.h')
-rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.h | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.h b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.h index f392895..15d7ec2 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.h +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.h @@ -25,14 +25,13 @@ public: virtual void HandleAsyncMisc(llvm::StringRef data) = 0; virtual void HandleStopReply() = 0; - // - /// Processes async structured data. + // ========================================================================= + /// Process asynchronously-received structured data. /// - /// @return - /// true if the data was handled; otherwise, false. - // - virtual bool - HandleAsyncStructuredData(const StructuredData::ObjectSP &object_sp) = 0; + /// @param[in] data + /// The complete data packet, expected to start with JSON-async. + // ========================================================================= + virtual void HandleAsyncStructuredDataPacket(llvm::StringRef data) = 0; }; GDBRemoteClientBase(const char *comm_name, const char *listener_name); |