Support for debugging against a remote stock gdbserver.

There are a couple of pieces:
 * some lazy-evaluation members that store info listed in a qSupported response
 * new method SendPacketsAndConcatenateResponses which is used for
   fetching fixed-size objects from the remote gdbserver by using multiple
   packets if necessary (first use will be to fetch shared-library XML files).

llvm-svn: 200072
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
index dcf638b..a1e982b 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
@@ -58,6 +58,27 @@
                                   StringExtractorGDBRemote &response,
                                   bool send_async);
 
+    // For packets which specify a range of output to be returned,
+    // return all of the output via a series of request packets of the form
+    // <prefix>0,<size>
+    // <prefix><size>,<size>
+    // <prefix><size>*2,<size>
+    // <prefix><size>*3,<size>
+    // ...
+    // until a "$l..." packet is received, indicating the end.
+    // (size is in hex; this format is used by a standard gdbserver to
+    // return the given portion of the output specified by <prefix>;
+    // for example, "qXfer:libraries-svr4:read::fff,1000" means
+    // "return a chunk of the xml description file for shared
+    // library load addresses, where the chunk starts at offset 0xfff
+    // and continues for 0x1000 bytes").
+    // Concatenate the resulting server response packets together and
+    // return in response_string.  If any packet fails, the return value
+    // indicates that failure and the returned string value is undefined.
+    PacketResult
+    SendPacketsAndConcatenateResponses (const char *send_payload_prefix,
+                                        std::string &response_string);
+
     lldb::StateType
     SendContinuePacketAndWaitForResponse (ProcessGDBRemote *process,
                                           const char *packet_payload,
@@ -248,6 +269,9 @@
     const lldb_private::ArchSpec &
     GetProcessArchitecture ();
 
+    void
+    GetRemoteQSupported();
+
     bool
     GetVContSupported (char flavor);
 
@@ -359,6 +383,18 @@
     bool
     SetCurrentThreadForRun (uint64_t tid);
 
+    bool
+    GetQXferLibrariesReadSupported ();
+
+    bool
+    GetQXferLibrariesSVR4ReadSupported ();
+
+    uint64_t
+    GetRemoteMaxPacketSize();
+
+    bool
+    GetAugmentedLibrariesSVR4ReadSupported ();
+
     lldb_private::LazyBool
     SupportsAllocDeallocMemory () // const
     {
@@ -489,7 +525,10 @@
     lldb_private::LazyBool m_prepare_for_reg_writing_reply;
     lldb_private::LazyBool m_supports_p;
     lldb_private::LazyBool m_supports_QSaveRegisterState;
-    
+    lldb_private::LazyBool m_supports_qXfer_libraries_read;
+    lldb_private::LazyBool m_supports_qXfer_libraries_svr4_read;
+    lldb_private::LazyBool m_supports_augmented_libraries_svr4_read;
+
     bool
         m_supports_qProcessInfoPID:1,
         m_supports_qfProcessInfo:1,
@@ -532,6 +571,7 @@
     std::string m_os_kernel;
     std::string m_hostname;
     uint32_t m_default_packet_timeout;
+    uint64_t m_max_packet_size;  // as returned by qSupported
     
     bool
     DecodeProcessInfoResponse (StringExtractorGDBRemote &response,