summaryrefslogtreecommitdiffstats
path: root/lldb/source/Interpreter/ScriptInterpreterPython.cpp
diff options
context:
space:
mode:
authorCaroline Tice <ctice@apple.com>2010-06-30 16:22:25 +0000
committerCaroline Tice <ctice@apple.com>2010-06-30 16:22:25 +0000
commitebc1bb277ccc583414b5695e10a708389a003b01 (patch)
treed58634deecd8330adec2efb0ea15915562ae90b7 /lldb/source/Interpreter/ScriptInterpreterPython.cpp
parent7764ae2c9862e05813617c2829f666968437637a (diff)
downloadbcm5719-llvm-ebc1bb277ccc583414b5695e10a708389a003b01.tar.gz
bcm5719-llvm-ebc1bb277ccc583414b5695e10a708389a003b01.zip
Add a unique ID to each debugger instance.
Add functions to look up debugger by id Add global variable to lldb python module, to hold debugger id Modify embedded Python interpreter to update the global variable with the id of its current debugger. Modify the char ** typemap definition in lldb.swig to accept 'None' (for NULL) as a valid value. The point of all this is so that, when you drop into the embedded interpreter from the command interpreter (or when doing Python-based breakpoint commands), there is a way for the Python side to find/get the correct debugger instance ( by checking debugger_unique_id, then calling SBDebugger::FindDebuggerWithID on it). llvm-svn: 107287
Diffstat (limited to 'lldb/source/Interpreter/ScriptInterpreterPython.cpp')
-rw-r--r--lldb/source/Interpreter/ScriptInterpreterPython.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lldb/source/Interpreter/ScriptInterpreterPython.cpp b/lldb/source/Interpreter/ScriptInterpreterPython.cpp
index 5fb0130f354..d7a33639a32 100644
--- a/lldb/source/Interpreter/ScriptInterpreterPython.cpp
+++ b/lldb/source/Interpreter/ScriptInterpreterPython.cpp
@@ -238,6 +238,10 @@ ScriptInterpreterPython::ScriptInterpreterPython (CommandInterpreter &interprete
PyRun_SimpleString ("new_mode[3] = new_mode[3] | ECHO | ICANON");
PyRun_SimpleString ("new_mode[6][VEOF] = 255");
PyRun_SimpleString ("tcsetattr (new_stdin, TCSANOW, new_mode)");
+
+ run_string.Clear();
+ run_string.Printf ("debugger_unique_id = %d", interpreter.GetDebugger().GetID());
+ PyRun_SimpleString (run_string.GetData());
}
OpenPOWER on IntegriCloud