summaryrefslogtreecommitdiffstats
path: root/lldb/source/Commands/CommandObjectProcess.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2013-05-10 23:48:10 +0000
committerGreg Clayton <gclayton@apple.com>2013-05-10 23:48:10 +0000
commitf9b57b9d77cd2b69073310cf265206e4452b0ac8 (patch)
tree954191a290a66ef52af11c5c26c84ecf2930ae50 /lldb/source/Commands/CommandObjectProcess.cpp
parent2b93c54c4a93c16c3d75ae996f916ec3b9b4a60b (diff)
downloadbcm5719-llvm-f9b57b9d77cd2b69073310cf265206e4452b0ac8.tar.gz
bcm5719-llvm-f9b57b9d77cd2b69073310cf265206e4452b0ac8.zip
<rdar://problem/13700260>
Avoid a deadlock when using the OperatingSystemPython code and typing "process interrupt". There was a possible lock inversion between the target API lock and the process' thread list lock due to code trying to discard the thread list. This was fixed by adding a boolean to Process::Halt() that indicates if the thread plans should be discarded and doing it in the private state thread when we process the stopped state. llvm-svn: 181651
Diffstat (limited to 'lldb/source/Commands/CommandObjectProcess.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectProcess.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/lldb/source/Commands/CommandObjectProcess.cpp b/lldb/source/Commands/CommandObjectProcess.cpp
index 7ad5f7be935..4c406a4f2aa 100644
--- a/lldb/source/Commands/CommandObjectProcess.cpp
+++ b/lldb/source/Commands/CommandObjectProcess.cpp
@@ -1470,7 +1470,7 @@ public:
protected:
bool
DoExecute (Args& command,
- CommandReturnObject &result)
+ CommandReturnObject &result)
{
Process *process = m_exe_ctx.GetProcessPtr();
if (process == NULL)
@@ -1482,14 +1482,11 @@ protected:
if (command.GetArgumentCount() == 0)
{
- Error error(process->Halt ());
+ bool clear_thread_plans = true;
+ Error error(process->Halt (clear_thread_plans));
if (error.Success())
{
result.SetStatus (eReturnStatusSuccessFinishResult);
-
- // Maybe we should add a "SuspendThreadPlans so we
- // can halt, and keep in place all the current thread plans.
- process->GetThreadList().DiscardThreadPlans();
}
else
{
OpenPOWER on IntegriCloud