Converted a display debug script for use by designers

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
This commit is contained in:
Ben Widawsky
2012-08-23 11:37:09 -07:00
parent ea944a9faf
commit d400551144
2 changed files with 189 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
#!/usr/bin/env python3
#this script helps to convert internal debugger scripts given to us into our tools
import sys
import fileinput
def replace_with_dict(text, dicto):
for key, val in dicto.items():
text = text.replace(key, val)
return text
for lines in fileinput.input([sys.argv[1]], inplace=True):
lines = lines.strip()
if lines == '': continue # strip empty lines
replace_dict = {'dword(' : '../tools/intel_reg_read ', 'MMADDR + ' : '', '//' : '#', ')p;' : '', ')p ' : ' -c '}
print(replace_with_dict(lines, replace_dict))