blob: d70155384b294e6d1aa059b46a88be0f7df0ca17 [file] [log] [blame]
"""Sanitizes the output from a run build with the sanitizer.
This script will attempt to translate addresses to locations.
Simply pipe the results from a run through this script. For example:
Create a build with the sanitizer enabled.
./android/ --no-strip --sanitizer=address
make -j48
and run it as follows;
./objs/emulator @x86_24 2>&1 | ./android/scripts/
import re
import sys
import subprocess
for line in sys.stdin.readlines():
match ='(#[0-9]+) (0x[A-Fa-f0-9]+) \((.*)\+0x(.*)\)$', line.rstrip())
if match and match.groups() > 2:
sys.stdout.write(" %s %s %s" % (,, subprocess.check_output( ["addr2line", "-e",,])))