summaryrefslogtreecommitdiffstats
path: root/lldb/scripts/Python/append-debugger-id.py
blob: ab119a86c40209ab23390f87efa426acfa3f91a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#
# 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."
OpenPOWER on IntegriCloud