diff options
author | Alexey Samsonov <samsonov@google.com> | 2012-07-19 15:07:26 +0000 |
---|---|---|
committer | Alexey Samsonov <samsonov@google.com> | 2012-07-19 15:07:26 +0000 |
commit | 08e80a43a4046f50270cc86b5ad3a16b94375f97 (patch) | |
tree | b10aef0e3245871cd7577a05fb11b7518b9241d7 /lib/asan/scripts | |
parent | 06c2e8fa4e4be2bddeade510b263b12f80945e4f (diff) | |
download | compiler-rt-08e80a43a4046f50270cc86b5ad3a16b94375f97.tar.gz compiler-rt-08e80a43a4046f50270cc86b5ad3a16b94375f97.tar.bz2 compiler-rt-08e80a43a4046f50270cc86b5ad3a16b94375f97.tar.xz |
[ASan] subtract one from PCs in ASan error reports (as they originally contain return addresses). Make output tests stricter.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@160508 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/asan/scripts')
-rwxr-xr-x | lib/asan/scripts/asan_symbolize.py | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/lib/asan/scripts/asan_symbolize.py b/lib/asan/scripts/asan_symbolize.py index 14ec5bf5..e4897d0c 100755 --- a/lib/asan/scripts/asan_symbolize.py +++ b/lib/asan/scripts/asan_symbolize.py @@ -17,22 +17,6 @@ pipes = {} filetypes = {} DEBUG=False -def patch_address(frameno, addr_s): - ''' Subtracts 1 or 2 from the top frame's address. - Top frame is normally the return address from asan_report* - call, which is not expected to return at all. Because of that, this - address often belongs to the next source code line, or even to a different - function. ''' - if frameno == '0': - addr = int(addr_s, 16) - if os.uname()[4].startswith('arm'): - # Cancel the Thumb bit - addr = addr & (~1) - addr -= 1 - return hex(addr) - return addr_s - - def fix_filename(file_name): for path_to_cut in sys.argv[1:]: file_name = re.sub(".*" + path_to_cut, "", file_name) @@ -49,7 +33,6 @@ def symbolize_addr2line(line): frameno = match.group(2) binary = match.group(3) addr = match.group(4) - addr = patch_address(frameno, addr) if not pipes.has_key(binary): pipes[binary] = subprocess.Popen(["addr2line", "-f", "-e", binary], stdin=subprocess.PIPE, stdout=subprocess.PIPE) @@ -90,7 +73,7 @@ def symbolize_atos(line): orig_addr = match.group(3) binary = match.group(4) offset = match.group(5) - addr = patch_address(frameno, orig_addr) + addr = orig_addr load_addr = hex(int(orig_addr, 16) - int(offset, 16)) filetype = get_macho_filetype(binary) |