diff options
author | Alexander Potapenko <glider@google.com> | 2012-01-24 10:44:44 +0000 |
---|---|---|
committer | Alexander Potapenko <glider@google.com> | 2012-01-24 10:44:44 +0000 |
commit | f4cea8f6f935c874b97669c7ca9819a224b78b48 (patch) | |
tree | 5b0e211c309b0950b8fe24f17dca36cb6830e528 /lib/asan/scripts | |
parent | f3810ea150e140f49bd62123885df922fe3c3b81 (diff) | |
download | compiler-rt-f4cea8f6f935c874b97669c7ca9819a224b78b48.tar.gz compiler-rt-f4cea8f6f935c874b97669c7ca9819a224b78b48.tar.bz2 compiler-rt-f4cea8f6f935c874b97669c7ca9819a224b78b48.tar.xz |
Tune asan_symbolize.py to symbolize 64-bit binaries correctly.
Add the DEBUG flag to test_output.sh
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@148798 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/asan/scripts')
-rwxr-xr-x | lib/asan/scripts/asan_symbolize.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/asan/scripts/asan_symbolize.py b/lib/asan/scripts/asan_symbolize.py index 80b59272..154e1f29 100755 --- a/lib/asan/scripts/asan_symbolize.py +++ b/lib/asan/scripts/asan_symbolize.py @@ -72,15 +72,20 @@ def symbolize_atos(line): addr = patch_address(frameno, addr) load_addr = int(addr, 16) - int(offset, 16) if not pipes.has_key(binary): - #print "atos -o %s -l %s" % (binary, hex(load_addr)) - pipes[binary] = subprocess.Popen(["atos", "-o", binary], + # Guess which arch we're running. 10 = len("0x") + 8 hex digits. + if len(addr) > 10: + arch = "x86_64" + else: + arch = "i386" + #print "atos -o %s -arch %s " % (binary, arch) + pipes[binary] = subprocess.Popen(["atos", "-o", binary, "-arch", arch], stdin=subprocess.PIPE, stdout=subprocess.PIPE,) p = pipes[binary] # TODO(glider): how to tell if the address is absolute? if ".app/" in binary and not ".framework" in binary: print >>p.stdin, "%s" % addr else: - print >>p.stdin, "%s" % offset + print >>p.stdin, "%s" % addr # TODO(glider): it's more efficient to make a batch atos run for each binary. p.stdin.close() atos_line = p.stdout.readline().rstrip() |