summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2011-11-17 04:46:02 +0000
committerGreg Clayton <gclayton@apple.com>2011-11-17 04:46:02 +0000
commite24c4acf6cd5ecbfed993c3b598dbc2fe24ab7ab (patch)
treedced64b42d76833da5cbbbc9da056f4c23fc57b2 /lldb/source/Plugins
parent857f9d6e5eef4efe9a9df1fd22f20210eeac5fc6 (diff)
downloadbcm5719-llvm-e24c4acf6cd5ecbfed993c3b598dbc2fe24ab7ab.tar.gz
bcm5719-llvm-e24c4acf6cd5ecbfed993c3b598dbc2fe24ab7ab.zip
Fixed the issue that was causing our monitor process threads to crash, it
turned out to be unitialized data in the ProcessLaunchInfo default constructor. Turning on MallocScribble in the environment helped track this down. When we launch and attach using the host layer, we now inform the process that it shouldn't detach when by calling an accessor. llvm-svn: 144882
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