summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Plugins')
-rw-r--r--lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp6
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp3
2 files changed, 8 insertions, 1 deletions
diff --git a/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp b/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
index df01e94cb14..fed40e0ff1b 100644
--- a/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
+++ b/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
@@ -97,6 +97,11 @@ ProcessKDP::ProcessKDP(Target& target, Listener &listener) :
ProcessKDP::~ProcessKDP()
{
Clear();
+ // We need to call finalize on the process before destroying ourselves
+ // to make sure all of the broadcaster cleanup goes as planned. If we
+ // destruct this class, then Process::~Process() might have problems
+ // trying to fully destroy the broadcaster.
+ Finalize();
}
//----------------------------------------------------------------------
@@ -620,7 +625,6 @@ ProcessKDP::DisableWatchpoint (Watchpoint *wp)
void
ProcessKDP::Clear()
{
- Mutex::Locker locker (m_thread_list.GetMutex ());
m_thread_list.Clear();
}
diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
index 1aa3c920a08..95d452f65bb 100644
--- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -1171,6 +1171,9 @@ ProcessGDBRemote::SetThreadStopInfo (StringExtractor& stop_packet)
{
// thread in big endian hex
tid = Args::StringToUInt32 (value.c_str(), 0, 16);
+ // m_thread_list does have its own mutex, but we need to
+ // hold onto the mutex between the call to m_thread_list.FindThreadByID(...)
+ // and the m_thread_list.AddThread(...) so it doesn't change on us
Mutex::Locker locker (m_thread_list.GetMutex ());
thread_sp = m_thread_list.FindThreadByID(tid, false);
if (!thread_sp)
OpenPOWER on IntegriCloud