mirror of
https://github.com/Gericom/teak-llvm.git
synced 2025-06-27 07:19:03 -04:00

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
28 lines
636 B
Python
28 lines
636 B
Python
#
|
|
# append-debugger-id.py
|
|
#
|
|
# This script adds a global variable, 'debugger_unique_id' to the lldb
|
|
# module (which was automatically generated via running swig), and
|
|
# initializes it to 0.
|
|
#
|
|
|
|
import sys
|
|
|
|
if len (sys.argv) != 2:
|
|
output_name = "./lldb.py"
|
|
else:
|
|
output_name = sys.argv[1] + "/lldb.py"
|
|
|
|
# print "output_name is '" + output_name + "'"
|
|
|
|
try:
|
|
f_out = open (output_name, 'a')
|
|
except IOError:
|
|
print "Error: Unable to open file for appending: " + output_name
|
|
else:
|
|
f_out.write ("debugger_unique_id = 0\n");
|
|
try:
|
|
f_out.close()
|
|
except IOError:
|
|
print "Error occurred while close file."
|