gdb-remote: Remove manual locking from GetShlibInfoAddr
authorPavel Labath <labath@google.com>
Thu, 18 Aug 2016 14:33:55 +0000 (14:33 +0000)
committerPavel Labath <labath@google.com>
Thu, 18 Aug 2016 14:33:55 +0000 (14:33 +0000)
The function can simply call the non-NoLock version of the SendPacket function and let it do the
locking.

llvm-svn: 279070

lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp

index fc0cf6e..00357dd 100644 (file)
@@ -2998,22 +2998,10 @@ GDBRemoteCommunicationClient::GetCurrentThreadIDs (std::vector<lldb::tid_t> &thr
 lldb::addr_t
 GDBRemoteCommunicationClient::GetShlibInfoAddr()
 {
-    Lock lock(*this, false);
-    if (lock)
-    {
-        StringExtractorGDBRemote response;
-        if (SendPacketAndWaitForResponse("qShlibInfoAddr", ::strlen ("qShlibInfoAddr"), response, false) == PacketResult::Success)
-        {
-            if (response.IsNormalResponse())
-                return response.GetHexMaxU64(false, LLDB_INVALID_ADDRESS);
-        }
-    }
-    else if (Log *log = ProcessGDBRemoteLog::GetLogIfAnyCategoryIsSet(GDBR_LOG_PROCESS | GDBR_LOG_PACKETS))
-    {
-        log->Printf("GDBRemoteCommunicationClient::%s: Didn't get sequence mutex for qShlibInfoAddr packet.",
-                    __FUNCTION__);
-    }
-    return LLDB_INVALID_ADDRESS;
+    StringExtractorGDBRemote response;
+    if (SendPacketAndWaitForResponse("qShlibInfoAddr", response, false) != PacketResult::Success || !response.IsNormalResponse())
+        return LLDB_INVALID_ADDRESS;
+    return response.GetHexMaxU64(false, LLDB_INVALID_ADDRESS);
 }
 
 lldb_private::Error