doc/TorBrowser/Hacking: convert-asan-to-symbolizer.py

File convert-asan-to-symbolizer.py, 392 bytes (added by tf, 18 months ago)

Python helper script to get symbols for a stack trace produced by ASan

Line 
1#!/usr/bin/env python
2
3# Author: Tommaso Frassetto, TU Darmstadt
4# This file is provided AS IS; any warranties are disclaimed.
5
6import sys
7import re
8
9def main():
10        inp = sys.stdin.read()
11        st = re.findall('\((.*)\+(.*)\)', inp)
12        dst = [(re.sub(r'/Browser/([^/]+$)', r'/Browser/.debug/\1', pth), ptr) for pth, ptr in st]
13        for pth, ptr in dst:
14                print pth, ptr
15
16if __name__ == '__main__':
17        main()