summaryrefslogtreecommitdiffstats
path: root/lldb/source/Interpreter/ScriptInterpreterPython.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2012-01-06 00:47:38 +0000
committerGreg Clayton <gclayton@apple.com>2012-01-06 00:47:38 +0000
commit1a0be3b1f2ab0597ece119ec3f48763aa73fc781 (patch)
treed233fb92641e68e82c0be10b4b63edde0f3ac011 /lldb/source/Interpreter/ScriptInterpreterPython.cpp
parent39c6d0f9ae60dae09d48eaa264339ff438bbebd2 (diff)
downloadbcm5719-llvm-1a0be3b1f2ab0597ece119ec3f48763aa73fc781.tar.gz
bcm5719-llvm-1a0be3b1f2ab0597ece119ec3f48763aa73fc781.zip
<rdar://problem/10649734>
Fixed an issue where the python interpreter could deadlock LLDB. llvm-svn: 147640
Diffstat (limited to 'lldb/source/Interpreter/ScriptInterpreterPython.cpp')
-rw-r--r--lldb/source/Interpreter/ScriptInterpreterPython.cpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/lldb/source/Interpreter/ScriptInterpreterPython.cpp b/lldb/source/Interpreter/ScriptInterpreterPython.cpp
index 241f081f6e6..ee3f14c8e62 100644
--- a/lldb/source/Interpreter/ScriptInterpreterPython.cpp
+++ b/lldb/source/Interpreter/ScriptInterpreterPython.cpp
@@ -594,14 +594,26 @@ ScriptInterpreterPython::InputReaderCallback
break;
case eInputReaderDeactivate:
- script_interpreter->LeaveSession ();
+ // When another input reader is pushed, don't leave the session...
+ //script_interpreter->LeaveSession ();
break;
case eInputReaderReactivate:
{
- ScriptInterpreterPython::Locker locker(script_interpreter,
- ScriptInterpreterPython::Locker::AcquireLock | ScriptInterpreterPython::Locker::InitSession,
- ScriptInterpreterPython::Locker::FreeAcquiredLock);
+ // Don't try and acquire the interpreter lock here because code like
+ // this:
+ //
+ // (lldb) script
+ // >>> v = lldb.frame.EvaluateExpression("collection->get_at_index(12)")
+ //
+ // This will cause the process to run. The interpreter lock is taken
+ // by the input reader for the "script" command. If we try and acquire
+ // the lock here, when the process runs it might deactivate this input
+ // reader (if STDIN is hooked up to the inferior process) and
+ // reactivate it when the process stops which will deadlock.
+ //ScriptInterpreterPython::Locker locker(script_interpreter,
+ // ScriptInterpreterPython::Locker::AcquireLock | ScriptInterpreterPython::Locker::InitSession,
+ // ScriptInterpreterPython::Locker::FreeAcquiredLock);
}
break;
OpenPOWER on IntegriCloud