diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2020-01-24 22:00:03 +0000 | 
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2020-01-24 22:00:03 +0000 | 
| commit | 480093f4440d54b30b3025afeac24b48f2ba7a2e (patch) | |
| tree | 162e72994062888647caf0d875428db9445491a8 /contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp | |
| parent | 489b1cf2ecf5b9b4a394857987014bfb09067726 (diff) | |
| parent | 706b4fc47bbc608932d3b491ae19a3b9cde9497b (diff) | |
Notes
Diffstat (limited to 'contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp')
| -rw-r--r-- | contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp | 31 | 
1 files changed, 17 insertions, 14 deletions
| diff --git a/contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp b/contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp index feb9f0589cee..b2f1ee527e8b 100644 --- a/contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp +++ b/contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp @@ -543,21 +543,24 @@ GDBRemoteCommunicationClient::SendThreadSpecificPacketAndWaitForResponse(  //  // Takes a valid thread ID because p needs to apply to a thread.  bool GDBRemoteCommunicationClient::GetpPacketSupported(lldb::tid_t tid) { -  if (m_supports_p == eLazyBoolCalculate) { -    m_supports_p = eLazyBoolNo; -    StreamString payload; -    payload.PutCString("p0"); -    StringExtractorGDBRemote response; -    if (SendThreadSpecificPacketAndWaitForResponse(tid, std::move(payload), -                                                   response, false) == -            PacketResult::Success && -        response.IsNormalResponse()) { -      m_supports_p = eLazyBoolYes; -    } -  } +  if (m_supports_p == eLazyBoolCalculate) +    m_supports_p = GetThreadPacketSupported(tid, "p0");    return m_supports_p;  } +LazyBool GDBRemoteCommunicationClient::GetThreadPacketSupported( +    lldb::tid_t tid, llvm::StringRef packetStr) { +  StreamString payload; +  payload.PutCString(packetStr); +  StringExtractorGDBRemote response; +  if (SendThreadSpecificPacketAndWaitForResponse( +          tid, std::move(payload), response, false) == PacketResult::Success && +      response.IsNormalResponse()) { +    return eLazyBoolYes; +  } +  return eLazyBoolNo; +} +  StructuredData::ObjectSP GDBRemoteCommunicationClient::GetThreadsInfo() {    // Get information on all threads at one using the "jThreadsInfo" packet    StructuredData::ObjectSP object_sp; @@ -1042,7 +1045,7 @@ void GDBRemoteCommunicationClient::MaybeEnableCompression(    }  #endif -#if defined(HAVE_LIBZ) +#if LLVM_ENABLE_ZLIB    if (avail_type == CompressionType::None) {      for (auto compression : supported_compressions) {        if (compression == "zlib-deflate") { @@ -3737,7 +3740,7 @@ bool GDBRemoteCommunicationClient::ReadExtFeature(      case ('m'):        if (str.length() > 1)          output << &str[1]; -      offset += size; +      offset += str.length() - 1;        break;      // unknown chunk | 
