diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-01-20 17:25:55 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-01-20 17:25:55 -0800 |
commit | 34b23b542e21b4606172984f9d54e592935827d6 (patch) | |
tree | 116ed9071c7c01284c3857b946a12959372108cb /tools/autodebugger_indenter.py | |
parent | 66a83e111658d9057806355a45b7e3fbcae74bf4 (diff) |
autodebugger indender tool
Diffstat (limited to 'tools/autodebugger_indenter.py')
-rw-r--r-- | tools/autodebugger_indenter.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tools/autodebugger_indenter.py b/tools/autodebugger_indenter.py new file mode 100644 index 00000000..12530cfb --- /dev/null +++ b/tools/autodebugger_indenter.py @@ -0,0 +1,20 @@ +''' +Autodebugger output contains -1 for function entry and -2 for function exit. +This script will indent the output nicely +''' + +import os, sys + +lines = sys.stdin.read().split('\n') + +depth = 0 +for i in range(len(lines)): + line = lines[i] + if line.startswith('AD:-2,'): + depth -= 1 + lines[i] = (' '*depth) + line + if line.startswith('AD:-1,'): + depth += 1 + +print '\n'.join(lines) + |