[ASan] subtract one from PCs in ASan error reports (as they originally contain return addresses). Make output tests stricter.

llvm-svn: 160508
diff --git a/compiler-rt/lib/asan/scripts/asan_symbolize.py b/compiler-rt/lib/asan/scripts/asan_symbolize.py
index 14ec5bf..e4897d0 100755
--- a/compiler-rt/lib/asan/scripts/asan_symbolize.py
+++ b/compiler-rt/lib/asan/scripts/asan_symbolize.py
@@ -17,22 +17,6 @@
 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 @@
     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 @@
     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)