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 | 1f397fb87f00124beb429343353f856b2947bffb (patch) | |
tree | 7a8f732b5951065d994d353e7cb5383b832bd77f /compiler-rt/lib/asan/scripts/asan_symbolize.py | |
parent | 7f1417f7cfd02e56f1d77830ddeb3e68485f0c59 (diff) | |
download | bcm5719-llvm-1f397fb87f00124beb429343353f856b2947bffb.tar.gz bcm5719-llvm-1f397fb87f00124beb429343353f856b2947bffb.zip |
Tune asan_symbolize.py to symbolize 64-bit binaries correctly.
Add the DEBUG flag to test_output.sh
llvm-svn: 148798
Diffstat (limited to 'compiler-rt/lib/asan/scripts/asan_symbolize.py')
-rwxr-xr-x | compiler-rt/lib/asan/scripts/asan_symbolize.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/compiler-rt/lib/asan/scripts/asan_symbolize.py b/compiler-rt/lib/asan/scripts/asan_symbolize.py index 80b59272516..154e1f2994b 100755 --- a/compiler-rt/lib/asan/scripts/asan_symbolize.py +++ b/compiler-rt/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() |