Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(22)

Unified Diff: tools/valgrind/asan/asan_symbolize.py

Issue 10836026: Merge Linux-specific bits from upstream asan_symbolize.py into Chrome (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/valgrind/asan/asan_symbolize.py
===================================================================
--- tools/valgrind/asan/asan_symbolize.py (revision 148930)
+++ tools/valgrind/asan/asan_symbolize.py (working copy)
@@ -11,15 +11,25 @@
import subprocess
pipes = {}
+filetypes = {}
vmaddrs = {}
+DEBUG=False
+def fix_filename(file_name):
+ for path_to_cut in sys.argv[1:]:
+ file_name = re.sub(".*" + path_to_cut, "", file_name)
+ file_name = re.sub(".*asan_[a-z_]*.cc:[0-9]*", "_asan_rtl_", file_name)
+ file_name = re.sub(".*crtstuff.c:0", "???:0", file_name)
+ return file_name
+
# TODO(glider): need some refactoring here
def symbolize_addr2line(line):
#0 0x7f6e35cf2e45 (/blah/foo.so+0x11fe45)
- match = re.match('^( *#[0-9]+ *0x[0-9a-f]+) *\((.*)\+(0x[0-9a-f]+)\)', line)
+ match = re.match('^( *#([0-9]+) *0x[0-9a-f]+) *\((.*)\+(0x[0-9a-f]+)\)', line)
if match:
- binary = match.group(2)
- addr = match.group(3)
+ frameno = match.group(2)
+ binary = match.group(3)
+ addr = match.group(4)
if not pipes.has_key(binary):
pipes[binary] = subprocess.Popen(["addr2line", "-f", "-e", binary],
stdin=subprocess.PIPE, stdout=subprocess.PIPE)
@@ -31,10 +41,7 @@
except:
function_name = ""
file_name = ""
- for path_to_cut in sys.argv[1:]:
- file_name = re.sub(".*" + path_to_cut, "", file_name)
- file_name = re.sub(".*asan_rtl.cc:[0-9]*", "_asan_rtl_", file_name)
- file_name = re.sub(".*crtstuff.c:0", "???:0", file_name)
+ file_name = fix_filename(file_name)
print match.group(1), "in", function_name, file_name
else:
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698