aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2011-06-09 21:11:21 -0700
committerAlon Zakai <alonzakai@gmail.com>2011-06-09 21:11:21 -0700
commitc9006752a0e80aa12d395c0dd6d53a9f5ec45aca (patch)
tree2168c76d0f86f5d1492a4afd6fb62724c8aa1096
parent6a4ed46be4758c34bf74eb1ec903cd912d55fe0e (diff)
autodebugger improvements for floats
-rw-r--r--tools/autodebugger.py2
-rw-r--r--tools/diff_autodebugger.py15
2 files changed, 16 insertions, 1 deletions
diff --git a/tools/autodebugger.py b/tools/autodebugger.py
index a744adb2..9b51ebc9 100644
--- a/tools/autodebugger.py
+++ b/tools/autodebugger.py
@@ -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
diff --git a/tools/diff_autodebugger.py b/tools/diff_autodebugger.py
new file mode 100644
index 00000000..0a2a7634
--- /dev/null
+++ b/tools/diff_autodebugger.py
@@ -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
+