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
This commit is contained in:
Caroline Tice
2010-06-30 16:22:25 +00:00
parent 7764ae2c98
commit ebc1bb277c
8 changed files with 80 additions and 3 deletions

View File

@@ -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());
}