[Lldb-commits] [lldb] r154603 - in /lldb/trunk/source/Plugins/Process: FreeBSD/ProcessFreeBSD.cpp FreeBSD/ProcessFreeBSD.h Linux/ProcessLinux.cpp Linux/ProcessLinux.h POSIX/ProcessPOSIX.cpp POSIX/ProcessPOSIX.h gdb-remote/GDBRemoteCommunication.cpp gdb-remote/GDBRemoteCommunication.h gdb-remote/GDBRemoteCommunicationClient.cpp gdb-remote/GDBRemoteRegisterContext.cpp
Greg Clayton
gclayton at apple.com
Thu Apr 12 12:04:34 PDT 2012
Author: gclayton
Date: Thu Apr 12 14:04:34 2012
New Revision: 154603
URL: http://llvm.org/viewvc/llvm-project?rev=154603&view=rev
Log:
Remove the GetSequenceMutex timeout that isn't being used in the GDB remote plug-in.
Also fixed the ProcessLinux, ProcessPOSIX and ProcessFreeBSD to have the correct UpdateThreadList() prototype.
Modified:
lldb/trunk/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp
lldb/trunk/source/Plugins/Process/FreeBSD/ProcessFreeBSD.h
lldb/trunk/source/Plugins/Process/Linux/ProcessLinux.cpp
lldb/trunk/source/Plugins/Process/Linux/ProcessLinux.h
lldb/trunk/source/Plugins/Process/POSIX/ProcessPOSIX.cpp
lldb/trunk/source/Plugins/Process/POSIX/ProcessPOSIX.h
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
Modified: lldb/trunk/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp?rev=154603&r1=154602&r2=154603&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp (original)
+++ lldb/trunk/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp Thu Apr 12 14:04:34 2012
@@ -131,11 +131,11 @@
{
}
-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;
}
Modified: lldb/trunk/source/Plugins/Process/FreeBSD/ProcessFreeBSD.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/FreeBSD/ProcessFreeBSD.h?rev=154603&r1=154602&r2=154603&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/FreeBSD/ProcessFreeBSD.h (original)
+++ lldb/trunk/source/Plugins/Process/FreeBSD/ProcessFreeBSD.h Thu Apr 12 14:04:34 2012
@@ -54,7 +54,7 @@
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);
//------------------------------------------------------------------
Modified: lldb/trunk/source/Plugins/Process/Linux/ProcessLinux.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/ProcessLinux.cpp?rev=154603&r1=154602&r2=154603&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Linux/ProcessLinux.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Linux/ProcessLinux.cpp Thu Apr 12 14:04:34 2012
@@ -94,7 +94,7 @@
}
-uint32_t
+bool
ProcessLinux::UpdateThreadList(ThreadList &old_thread_list, ThreadList &new_thread_list)
{
LogSP log (ProcessPOSIXLog::GetLogIfAllCategoriesSet (POSIX_LOG_THREAD));
@@ -114,7 +114,7 @@
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;
}
Modified: lldb/trunk/source/Plugins/Process/Linux/ProcessLinux.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/ProcessLinux.h?rev=154603&r1=154602&r2=154603&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Linux/ProcessLinux.h (original)
+++ lldb/trunk/source/Plugins/Process/Linux/ProcessLinux.h Thu Apr 12 14:04:34 2012
@@ -53,7 +53,7 @@
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
Modified: lldb/trunk/source/Plugins/Process/POSIX/ProcessPOSIX.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/POSIX/ProcessPOSIX.cpp?rev=154603&r1=154602&r2=154603&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/POSIX/ProcessPOSIX.cpp (original)
+++ lldb/trunk/source/Plugins/Process/POSIX/ProcessPOSIX.cpp Thu Apr 12 14:04:34 2012
@@ -489,7 +489,7 @@
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 @@
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
Modified: lldb/trunk/source/Plugins/Process/POSIX/ProcessPOSIX.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/POSIX/ProcessPOSIX.h?rev=154603&r1=154602&r2=154603&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/POSIX/ProcessPOSIX.h (original)
+++ lldb/trunk/source/Plugins/Process/POSIX/ProcessPOSIX.h Thu Apr 12 14:04:34 2012
@@ -105,7 +105,7 @@
virtual uint32_t
UpdateThreadListIfNeeded();
- virtual uint32_t
+ virtual bool
UpdateThreadList(lldb_private::ThreadList &old_thread_list,
lldb_private::ThreadList &new_thread_list) = 0;
Modified: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp?rev=154603&r1=154602&r2=154603&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp Thu Apr 12 14:04:34 2012
@@ -225,14 +225,9 @@
}
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());
}
Modified: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h?rev=154603&r1=154602&r2=154603&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h Thu Apr 12 14:04:34 2012
@@ -59,7 +59,7 @@
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,
Modified: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp?rev=154603&r1=154602&r2=154603&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp Thu Apr 12 14:04:34 2012
@@ -259,7 +259,7 @@
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 @@
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 @@
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 @@
Mutex::Locker locker;
thread_ids.clear();
- if (GetSequenceMutex (locker, 0))
+ if (GetSequenceMutex (locker))
{
sequence_mutex_unavailable = false;
StringExtractorGDBRemote response;
@@ -1872,6 +1872,9 @@
}
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();
Modified: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp?rev=154603&r1=154602&r2=154603&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp Thu Apr 12 14:04:34 2012
@@ -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 @@
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 @@
}
}
}
+ 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 @@
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 @@
}
}
}
+ 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 @@
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 @@
}
}
}
+ 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 @@
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 @@
}
}
}
+ 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;
}
More information about the lldb-commits
mailing list