Adding support for setting thread stop state when a process stops

Programming / Debugging / LLDB - Andrew Kaylor [intel.com] - 10 May 2013 12:19 UTC

This re-submission of this patch fixes a problem where the code sometimes caused a deadlock. The Process::SetPrivateState method was locking the Process::m_private_state variable and then later calling ThreadList::DidStop, which locks the ThreadList mutex. Other methods in ThreadList which were being called from other threads lock the ThreadList mutex and then call Process::GetPrivateState which locks the Process::m_private_state mutex. To avoid deadlocks, Process::SetPrivateState now locks the ThreadList mutex before locking the Process::m_private_state mutex.

1f85fa8 Adding support for setting thread stop state when a process stops.
include/lldb/Target/Thread.h | 4 ++++
include/lldb/Target/ThreadList.h | 3 +++
source/Target/Process.cpp | 14 +++++++++++++
source/Target/Thread.cpp | 6 ++++++
source/Target/ThreadList.cpp | 22 ++++++++++++++++++++
.../thread/state/TestThreadStates.py | 2 --
6 files changed, 49 insertions(+), 2 deletions(-)

Upstream: github.com


  • Share