summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
diff options
context:
space:
mode:
authorEnrico Granata <egranata@apple.com>2016-02-09 05:46:47 +0000
committerEnrico Granata <egranata@apple.com>2016-02-09 05:46:47 +0000
commitb1cf558d8335ddfe517d96740a47fc4f65a2b8b8 (patch)
tree88befc478a13fba3e287594b185ff4a253e3f7fc /lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
parentc2f25cc4cc25455f394d6bf10aa31866d2c3b490 (diff)
downloadbcm5719-llvm-b1cf558d8335ddfe517d96740a47fc4f65a2b8b8.tar.gz
bcm5719-llvm-b1cf558d8335ddfe517d96740a47fc4f65a2b8b8.zip
Fix an issue where pressing CTRL+C in the interactive script interpreter causes LLDB to crash
This is because PyThreadState_Get() assumes a non-NULL thread state and crashes otherwise; but PyThreadState_GET is just a shortcut (in non-Python-debugging builds) for the global variable that holds the thread state The behavior of CTRL+C is slightly more erratic than one would like. CTRL+C in the middle of execution of Python code will cause that execution to be interrupted (e.g. time.sleep(1000)), but a CTRL+C at the prompt will just cause a KeyboardInterrupt and not exit the interpreter - worse, it will only trigger the exception once one presses ENTER. None of this is optimal, of course, but I don't have a lot of time to appease the Python deities with the proper spells right now, and fixing the crasher is already a good thing in and of itself llvm-svn: 260199
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp')
-rw-r--r--lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
index 3a11b83633a..99e1d099788 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
+++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
@@ -1019,7 +1019,7 @@ ScriptInterpreterPython::Interrupt()
if (IsExecutingPython())
{
- PyThreadState *state = PyThreadState_Get();
+ PyThreadState *state = PyThreadState_GET();
if (!state)
state = GetThreadState();
if (state)
OpenPOWER on IntegriCloud