diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-04-11 18:30:46 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-04-11 18:30:46 -0700 |
commit | 82d12c4fc04647cfdd2cb7624321a5380806525f (patch) | |
tree | 0f4afae0c43004a590c0e2080fd286bcda992092 /tools/autodebugger.py | |
parent | 4cc9e016a4ff9d64cdddf34c2f9c3eb153ed7b3f (diff) |
more autodebugger capabilities
Diffstat (limited to 'tools/autodebugger.py')
-rw-r--r-- | tools/autodebugger.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/autodebugger.py b/tools/autodebugger.py index 51661ec7..08cb1c66 100644 --- a/tools/autodebugger.py +++ b/tools/autodebugger.py @@ -11,6 +11,7 @@ Warning: You probably want to compile with SKIP_STACK_IN_SMALL=0! Otherwise import os, sys, re ALLOW_POINTERS = False +ALLOW_MISC = True MEMCPY = False POSTAMBLE = ''' @@ -242,6 +243,14 @@ for i in range(len(lines)): index = i+1+lines_added lines[i] += '\n call void @emscripten_autodebug_%s(i32 %d, %s %%%s)' % (m.group('type'), index, m.group('type'), m.group('var')) lines_added += 1 + continue + if ALLOW_MISC: + m = re.match(' %(?P<var>[\w_.]+) = (call|mul|add) (nsw )?(?P<type>i64|i32|i16|i8|float|double+) .*', lines[i]) + if m: + index = i+1+lines_added + lines[i] += '\n call void @emscripten_autodebug_%s(i32 %d, %s %%%s)' % (m.group('type'), index, m.group('type'), m.group('var')) + lines_added += 1 + continue finally: if len(pre) > 0: lines[i] = pre + '\n' + lines[i] |