aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/bt.py
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/bt.py')
-rwxr-xr-xcontrib/bt.py33
1 files changed, 33 insertions, 0 deletions
diff --git a/contrib/bt.py b/contrib/bt.py
new file mode 100755
index 000000000..1b111efc8
--- /dev/null
+++ b/contrib/bt.py
@@ -0,0 +1,33 @@
+#!/usr/bin/env python
+
+import os
+
+f = open("unbalanced")
+lines = []
+for line in f:
+ lines.append(line)
+
+filenames = {}
+
+output = []
+for line in lines:
+ if "[0x" in line:
+ start = line.find("[")
+ end = line.find("]")
+ addr = line[start+1:end]
+ try:
+ file = filenames[addr]
+ except KeyError:
+ r = os.popen("addr2line -fs -e ./bsc_hack %s" % addr)
+ all = r.read().replace("\n", ",")
+ file = all
+ filenames[addr] = file
+
+ line = line.replace(addr, file)
+ output.append(line)
+
+g = open("unbalanced.2", "w")
+g.write("".join(output))
+
+
+