Caroline Tice | 558be58 | 2010-06-30 16:22:25 +0000 | [diff] [blame^] | 1 | # |
| 2 | # append-debugger-id.py |
| 3 | # |
| 4 | # This script adds a global variable, 'debugger_unique_id' to the lldb |
| 5 | # module (which was automatically generated via running swig), and |
| 6 | # initializes it to 0. |
| 7 | # |
| 8 | |
| 9 | import sys |
| 10 | |
| 11 | if len (sys.argv) != 2: |
| 12 | output_name = "./lldb.py" |
| 13 | else: |
| 14 | output_name = sys.argv[1] + "/lldb.py" |
| 15 | |
| 16 | # print "output_name is '" + output_name + "'" |
| 17 | |
| 18 | try: |
| 19 | f_out = open (output_name, 'a') |
| 20 | except IOError: |
| 21 | print "Error: Unable to open file for appending: " + output_name |
| 22 | else: |
| 23 | f_out.write ("debugger_unique_id = 0\n"); |
| 24 | try: |
| 25 | f_out.close() |
| 26 | except IOError: |
| 27 | print "Error occurred while close file." |