gdb-remote: Centralize thread specific packet handling
authorPavel Labath <labath@google.com>
Thu, 18 Aug 2016 08:30:03 +0000 (08:30 +0000)
committerPavel Labath <labath@google.com>
Thu, 18 Aug 2016 08:30:03 +0000 (08:30 +0000)
commit4b6f9591d390c317084e63ed3e695c7a19c64543
tree2d7a1151219b81ee322add30cadffd173d47cd77
parentc233995b1e2b514a4366248827e904e3c37e7582
gdb-remote: Centralize thread specific packet handling

Summary:
Before this, each function had a copy of the code which handled appending of the thread suffix to
the packet (or using $Hg instead). I have moved that code into a single function and made
everyone else use that. The function takes the partial packet as a StreamString rvalue reference,
to avoid a copy and to remind the users that the packet will have undeterminate contents after
the call.

This also fixes the incorrect formatting of the QRestoreRegisterState packet in case thread
suffix is not supported.

Reviewers: clayborg

Subscribers: lldb-commits

Differential Revision: https://reviews.llvm.org/D23604

llvm-svn: 279040
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp