diff options
-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) + |