summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp4
-rw-r--r--lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.h2
-rw-r--r--lldb/source/Plugins/Process/Linux/ProcessLinux.cpp4
-rw-r--r--lldb/source/Plugins/Process/Linux/ProcessLinux.h2
-rw-r--r--lldb/source/Plugins/Process/POSIX/ProcessPOSIX.cpp4
-rw-r--r--lldb/source/Plugins/Process/POSIX/ProcessPOSIX.h2
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp9
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h2
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp11
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp34
10 files changed, 49 insertions, 25 deletions
diff --git a/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp b/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp
index 41dc93c9e47..fd5102682ee 100644
--- a/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp
+++ b/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp
@@ -131,11 +131,11 @@ ProcessFreeBSD::Terminate()
{
}
-uint32_t
+bool
ProcessFreeBSD::UpdateThreadList(ThreadList &old_thread_list, ThreadList &new_thread_list)
{
// XXX haxx
new_thread_list = old_thread_list;
- return 0;
+ return false;
}
diff --git a/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.h b/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.h
index 304fa4c382a..74996f13127 100644
--- a/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.h
+++ b/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.h
@@ -54,7 +54,7 @@ public:
ProcessFreeBSD(lldb_private::Target& target,
lldb_private::Listener &listener);
- virtual uint32_t
+ virtual bool
UpdateThreadList(lldb_private::ThreadList &old_thread_list, lldb_private::ThreadList &new_thread_list);
//------------------------------------------------------------------
diff --git a/lldb/source/Plugins/Process/Linux/ProcessLinux.cpp b/lldb/source/Plugins/Process/Linux/ProcessLinux.cpp
index 69d54ccf639..3327914d8bc 100644
--- a/lldb/source/Plugins/Process/Linux/ProcessLinux.cpp
+++ b/lldb/source/Plugins/Process/Linux/ProcessLinux.cpp
@@ -94,7 +94,7 @@ ProcessLinux::GetPluginDescriptionStatic()
}
-uint32_t
+bool
ProcessLinux::UpdateThreadList(ThreadList &old_thread_list, ThreadList &new_thread_list)
{
LogSP log (ProcessPOSIXLog::GetLogIfAllCategoriesSet (POSIX_LOG_THREAD));
@@ -114,7 +114,7 @@ ProcessLinux::UpdateThreadList(ThreadList &old_thread_list, ThreadList &new_thre
log->Printf ("ProcessLinux::%s() updated pid = %i", __FUNCTION__, GetID());
new_thread_list.AddThread(thread_sp);
- return new_thread_list.GetSize(false);
+ return new_thread_list.GetSize(false) > 0;
}
diff --git a/lldb/source/Plugins/Process/Linux/ProcessLinux.h b/lldb/source/Plugins/Process/Linux/ProcessLinux.h
index 49fdb45151c..9acbf49f5f0 100644
--- a/lldb/source/Plugins/Process/Linux/ProcessLinux.h
+++ b/lldb/source/Plugins/Process/Linux/ProcessLinux.h
@@ -53,7 +53,7 @@ public:
ProcessLinux(lldb_private::Target& target,
lldb_private::Listener &listener);
- virtual uint32_t
+ virtual bool
UpdateThreadList(lldb_private::ThreadList &old_thread_list, lldb_private::ThreadList &new_thread_list);
//------------------------------------------------------------------
// PluginInterface protocol
diff --git a/lldb/source/Plugins/Process/POSIX/ProcessPOSIX.cpp b/lldb/source/Plugins/Process/POSIX/ProcessPOSIX.cpp
index 332dc415cf2..b8b989b5224 100644
--- a/lldb/source/Plugins/Process/POSIX/ProcessPOSIX.cpp
+++ b/lldb/source/Plugins/Process/POSIX/ProcessPOSIX.cpp
@@ -489,7 +489,7 @@ ProcessPOSIX::UpdateThreadListIfNeeded()
return m_thread_list.GetSize(false);
}
-uint32_t
+bool
ProcessPOSIX::UpdateThreadList(ThreadList &old_thread_list, ThreadList &new_thread_list)
{
LogSP log (ProcessPOSIXLog::GetLogIfAllCategoriesSet (POSIX_LOG_THREAD));
@@ -509,7 +509,7 @@ ProcessPOSIX::UpdateThreadList(ThreadList &old_thread_list, ThreadList &new_thre
log->Printf ("ProcessPOSIX::%s() updated pid = %i", __FUNCTION__, GetID());
new_thread_list.AddThread(thread_sp);
- return new_thread_list.GetSize(false);
+ return new_thread_list.GetSize(false) > 0;
}
ByteOrder
diff --git a/lldb/source/Plugins/Process/POSIX/ProcessPOSIX.h b/lldb/source/Plugins/Process/POSIX/ProcessPOSIX.h
index dd887cf0894..adcdee5de92 100644
--- a/lldb/source/Plugins/Process/POSIX/ProcessPOSIX.h
+++ b/lldb/source/Plugins/Process/POSIX/ProcessPOSIX.h
@@ -105,7 +105,7 @@ public:
virtual uint32_t
UpdateThreadListIfNeeded();
- virtual uint32_t
+ virtual bool
UpdateThreadList(lldb_private::ThreadList &old_thread_list,
lldb_private::ThreadList &new_thread_list) = 0;
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
index 1535fd41260..0d39e98f428 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
@@ -225,14 +225,9 @@ GDBRemoteCommunication::GetAck ()
}
bool
-GDBRemoteCommunication::GetSequenceMutex (Mutex::Locker& locker, uint32_t usec_timeout)
+GDBRemoteCommunication::GetSequenceMutex (Mutex::Locker& locker)
{
- if (usec_timeout == 0)
- return locker.TryLock (m_sequence_mutex.GetMutex());
-
- // Wait for the lock
- locker.Lock (m_sequence_mutex.GetMutex());
- return true;
+ return locker.TryLock (m_sequence_mutex.GetMutex());
}
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h
index ef0c1983898..83bbfd59b8d 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h
@@ -59,7 +59,7 @@ public:
size_t payload_length);
bool
- GetSequenceMutex (lldb_private::Mutex::Locker& locker, uint32_t usec_timeout);
+ GetSequenceMutex (lldb_private::Mutex::Locker& locker);
bool
CheckForPacket (const uint8_t *src,
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
index 4efacd57eee..a31f48af1f7 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
@@ -259,7 +259,7 @@ GDBRemoteCommunicationClient::SendPacketAndWaitForResponse
Mutex::Locker locker;
LogSP log (ProcessGDBRemoteLog::GetLogIfAllCategoriesSet (GDBR_LOG_PROCESS));
size_t response_len = 0;
- if (GetSequenceMutex (locker, 0))
+ if (GetSequenceMutex (locker))
{
if (SendPacketNoLock (payload, payload_length))
response_len = WaitForPacketWithTimeoutMicroSecondsNoLock (response, GetPacketTimeoutInMicroSeconds ());
@@ -350,7 +350,7 @@ GDBRemoteCommunicationClient::SendPacketAndWaitForResponse
else
{
if (log)
- log->Printf("error: packet mutex taken and send_async == false, not sending packet '%*s'", (int) payload_length, payload);
+ log->Printf("error: failed to get packet sequence mutex, not sending packet '%*s'", (int) payload_length, payload);
}
}
if (response_len == 0)
@@ -648,7 +648,7 @@ GDBRemoteCommunicationClient::SendInterrupt
if (IsRunning())
{
// Only send an interrupt if our debugserver is running...
- if (GetSequenceMutex (locker, 0))
+ if (GetSequenceMutex (locker))
{
if (log)
log->Printf ("SendInterrupt () - got sequence mutex without having to interrupt");
@@ -1843,7 +1843,7 @@ GDBRemoteCommunicationClient::GetCurrentThreadIDs (std::vector<lldb::tid_t> &thr
Mutex::Locker locker;
thread_ids.clear();
- if (GetSequenceMutex (locker, 0))
+ if (GetSequenceMutex (locker))
{
sequence_mutex_unavailable = false;
StringExtractorGDBRemote response;
@@ -1872,6 +1872,9 @@ GDBRemoteCommunicationClient::GetCurrentThreadIDs (std::vector<lldb::tid_t> &thr
}
else
{
+ LogSP log (ProcessGDBRemoteLog::GetLogIfAnyCategoryIsSet (GDBR_LOG_PROCESS | GDBR_LOG_PACKETS));
+ if (log)
+ log->Printf("error: failed to get packet sequence mutex, not sending packet 'qfThreadInfo'");
sequence_mutex_unavailable = true;
}
return thread_ids.size();
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
index 33b74b42085..ec2cfd88489 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
@@ -21,6 +21,7 @@
// Project includes
#include "Utility/StringExtractorGDBRemote.h"
#include "ProcessGDBRemote.h"
+#include "ProcessGDBRemoteLog.h"
#include "ThreadGDBRemote.h"
#include "Utility/ARM_GCC_Registers.h"
#include "Utility/ARM_DWARF_Registers.h"
@@ -181,7 +182,7 @@ GDBRemoteRegisterContext::ReadRegisterBytes (const RegisterInfo *reg_info, DataE
if (!m_reg_valid[reg])
{
Mutex::Locker locker;
- if (gdb_comm.GetSequenceMutex (locker, 0))
+ if (gdb_comm.GetSequenceMutex (locker))
{
const bool thread_suffix_supported = gdb_comm.GetThreadSuffixSupported();
ProcessSP process_sp (m_thread.GetProcess());
@@ -241,6 +242,12 @@ GDBRemoteRegisterContext::ReadRegisterBytes (const RegisterInfo *reg_info, DataE
}
}
}
+ else
+ {
+ LogSP log (ProcessGDBRemoteLog::GetLogIfAnyCategoryIsSet (GDBR_LOG_THREAD | GDBR_LOG_PACKETS));
+ if (log)
+ log->Printf("error: failed to get packet sequence mutex, not sending read register for \"%s\"", reg_info->name);
+ }
// Make sure we got a valid register value after reading it
if (!m_reg_valid[reg])
@@ -331,7 +338,7 @@ GDBRemoteRegisterContext::WriteRegisterBytes (const lldb_private::RegisterInfo *
m_reg_data.GetByteOrder())) // dst byte order
{
Mutex::Locker locker;
- if (gdb_comm.GetSequenceMutex (locker, 0))
+ if (gdb_comm.GetSequenceMutex (locker))
{
const bool thread_suffix_supported = gdb_comm.GetThreadSuffixSupported();
ProcessSP process_sp (m_thread.GetProcess());
@@ -420,6 +427,12 @@ GDBRemoteRegisterContext::WriteRegisterBytes (const lldb_private::RegisterInfo *
}
}
}
+ else
+ {
+ LogSP log (ProcessGDBRemoteLog::GetLogIfAnyCategoryIsSet (GDBR_LOG_THREAD | GDBR_LOG_PACKETS));
+ if (log)
+ log->Printf("error: failed to get packet sequence mutex, not sending write register for \"%s\"", reg_info->name);
+ }
}
return false;
}
@@ -440,7 +453,7 @@ GDBRemoteRegisterContext::ReadAllRegisterValues (lldb::DataBufferSP &data_sp)
StringExtractorGDBRemote response;
Mutex::Locker locker;
- if (gdb_comm.GetSequenceMutex (locker, 0))
+ if (gdb_comm.GetSequenceMutex (locker))
{
char packet[32];
const bool thread_suffix_supported = gdb_comm.GetThreadSuffixSupported();
@@ -475,6 +488,13 @@ GDBRemoteRegisterContext::ReadAllRegisterValues (lldb::DataBufferSP &data_sp)
}
}
}
+ else
+ {
+ LogSP log (ProcessGDBRemoteLog::GetLogIfAnyCategoryIsSet (GDBR_LOG_THREAD | GDBR_LOG_PACKETS));
+ if (log)
+ log->Printf("error: failed to get packet sequence mutex, not sending read all registers");
+ }
+
data_sp.reset();
return false;
}
@@ -496,7 +516,7 @@ GDBRemoteRegisterContext::WriteAllRegisterValues (const lldb::DataBufferSP &data
StringExtractorGDBRemote response;
Mutex::Locker locker;
- if (gdb_comm.GetSequenceMutex (locker, 0))
+ if (gdb_comm.GetSequenceMutex (locker))
{
const bool thread_suffix_supported = gdb_comm.GetThreadSuffixSupported();
ProcessSP process_sp (m_thread.GetProcess());
@@ -592,6 +612,12 @@ GDBRemoteRegisterContext::WriteAllRegisterValues (const lldb::DataBufferSP &data
}
}
}
+ else
+ {
+ LogSP log (ProcessGDBRemoteLog::GetLogIfAnyCategoryIsSet (GDBR_LOG_THREAD | GDBR_LOG_PACKETS));
+ if (log)
+ log->Printf("error: failed to get packet sequence mutex, not sending write all registers");
+ }
return false;
}
OpenPOWER on IntegriCloud