diff options
author | Greg Clayton <gclayton@apple.com> | 2012-04-10 00:18:59 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2012-04-10 00:18:59 +0000 |
commit | 9fc13556b4c58c850fde19b306fd01c87c62f5fa (patch) | |
tree | c7b21c98f9048caf161b5492d3c0b21f14ccd441 /lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp | |
parent | 1d9672bdce801aa2674bb3c572f3eac660bd7a49 (diff) | |
download | llvm-9fc13556b4c58c850fde19b306fd01c87c62f5fa.zip llvm-9fc13556b4c58c850fde19b306fd01c87c62f5fa.tar.gz llvm-9fc13556b4c58c850fde19b306fd01c87c62f5fa.tar.bz2 |
Trying to solve our disappearing thread issues by making thread list updates safer.
The current ProcessGDBRemote function that updates the threads could end up with an empty list if any other thread had the sequence mutex. We now don't clear the thread list when we can't access it, and we also have changed how lldb_private::Process handles the return code from the:
virtual bool
Process::UpdateThreadList (lldb_private::ThreadList &old_thread_list,
lldb_private::ThreadList &new_thread_list) = 0;
A bool is now returned to indicate if the list was actually updated or not and the lldb_private::Process class will only update the stop ID of the validity of the thread list if "true" is returned.
The ProcessGDBRemote also got an extra assertion that will hopefully assert when running debug builds so we can find the source of this issue.
llvm-svn: 154365
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp')
-rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp index 77051ff..120caf3 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp @@ -181,7 +181,7 @@ GDBRemoteRegisterContext::ReadRegisterBytes (const RegisterInfo *reg_info, DataE if (!m_reg_valid[reg]) { Mutex::Locker locker; - if (gdb_comm.GetSequenceMutex (locker)) + if (gdb_comm.TryLockSequenceMutex (locker)) { const bool thread_suffix_supported = gdb_comm.GetThreadSuffixSupported(); ProcessSP process_sp (m_thread.GetProcess()); @@ -331,7 +331,7 @@ GDBRemoteRegisterContext::WriteRegisterBytes (const lldb_private::RegisterInfo * m_reg_data.GetByteOrder())) // dst byte order { Mutex::Locker locker; - if (gdb_comm.GetSequenceMutex (locker)) + if (gdb_comm.TryLockSequenceMutex (locker)) { const bool thread_suffix_supported = gdb_comm.GetThreadSuffixSupported(); ProcessSP process_sp (m_thread.GetProcess()); @@ -440,7 +440,7 @@ GDBRemoteRegisterContext::ReadAllRegisterValues (lldb::DataBufferSP &data_sp) StringExtractorGDBRemote response; Mutex::Locker locker; - if (gdb_comm.GetSequenceMutex (locker)) + if (gdb_comm.TryLockSequenceMutex (locker)) { char packet[32]; const bool thread_suffix_supported = gdb_comm.GetThreadSuffixSupported(); @@ -496,7 +496,7 @@ GDBRemoteRegisterContext::WriteAllRegisterValues (const lldb::DataBufferSP &data StringExtractorGDBRemote response; Mutex::Locker locker; - if (gdb_comm.GetSequenceMutex (locker)) + if (gdb_comm.TryLockSequenceMutex (locker)) { const bool thread_suffix_supported = gdb_comm.GetThreadSuffixSupported(); ProcessSP process_sp (m_thread.GetProcess()); |