From ebc1bb277ccc583414b5695e10a708389a003b01 Mon Sep 17 00:00:00 2001 From: Caroline Tice Date: Wed, 30 Jun 2010 16:22:25 +0000 Subject: 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 --- lldb/source/Interpreter/ScriptInterpreterPython.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lldb/source/Interpreter/ScriptInterpreterPython.cpp') diff --git a/lldb/source/Interpreter/ScriptInterpreterPython.cpp b/lldb/source/Interpreter/ScriptInterpreterPython.cpp index 5fb0130f354a..d7a33639a32a 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()); } -- cgit v1.2.3