autodebugger improvements for floats

This commit is contained in:
Alon Zakai 2011-06-09 21:11:21 -07:00
Родитель 6a4ed46be4
Коммит c9006752a0
2 изменённых файлов: 16 добавлений и 1 удалений

Просмотреть файл

@ -141,7 +141,7 @@ for i in range(len(lines)):
#if i == 5:
# lines[i] += '\n
m = re.match(' store (?P<type>i64|i32|i16|i8) %(?P<var>[\w.]+), .*', lines[i])
m = re.match(' store (?P<type>i64|i32|i16|i8|float|double) %(?P<var>[\w.]+), .*', lines[i])
if m and m.group('type') in ['i8', 'i16', 'i32', 'i64', 'float', 'double']:
lines[i] += '\n call void @emscripten_autodebug_%s(i32 %d, %s %%%s)' % (m.group('type'), i+1+lines_added, m.group('type'), m.group('var'))
lines_added += 1

Просмотреть файл

@ -0,0 +1,15 @@
'''
Very simple line-by line diff of autodebugger outputs. useful when there are no added or removed lines,
and there are float differences
'''
import os, sys
f1 = open(sys.argv[1], 'r').readlines()
f2 = open(sys.argv[2], 'r').readlines()
for i in range(len(f1)):
if f1[i] == f2[i]: continue
v1 = float(f1[i].split(',')[1])
v2 = float(f2[i].split(',')[1])
print '%5d %10s %f ' % (i+1, f1[i].split(',')[0], v1-v2), ' ', v1-v2, v1, v2