diff options
author | dank@chromium.org <dank@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-26 22:45:11 +0000 |
---|---|---|
committer | dank@chromium.org <dank@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-26 22:45:11 +0000 |
commit | 9970340aaa6c19345041261acb516a6c7bbd2bed (patch) | |
tree | 22a8bcee5fbf36e19be36f6056e531e441346ff9 | |
parent | 3ee085030c6bc6119248f856313266b1a354143c (diff) | |
download | chromium_src-9970340aaa6c19345041261acb516a6c7bbd2bed.zip chromium_src-9970340aaa6c19345041261acb516a6c7bbd2bed.tar.gz chromium_src-9970340aaa6c19345041261acb516a6c7bbd2bed.tar.bz2 |
Reverting 24548.
Review URL: http://codereview.chromium.org/174576
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24551 0039d316-1c4b-4281-b951-d872f2087c98
-rwxr-xr-x | tools/valgrind/build-valgrind-for-chromium.sh | 4 | ||||
-rwxr-xr-x | tools/valgrind/memcheck_analyze.py | 52 | ||||
-rwxr-xr-x | tools/valgrind/valgrind_test.py | 14 | ||||
-rw-r--r-- | tools/valgrind/xml-loadadr.patch | 13 |
4 files changed, 14 insertions, 69 deletions
diff --git a/tools/valgrind/build-valgrind-for-chromium.sh b/tools/valgrind/build-valgrind-for-chromium.sh index 4d8c513..06b6ef6 100755 --- a/tools/valgrind/build-valgrind-for-chromium.sh +++ b/tools/valgrind/build-valgrind-for-chromium.sh @@ -64,10 +64,6 @@ then # "Want --show-possible option so I can ignore the bazillion possible leaks..." patch -p0 < "${THISDIR}/possible.patch" - # Add feature bug https://bugs.kde.org/show_bug.cgi?id=205000 - # "Need library load address in log files" - patch -p0 < "${THISDIR}/xml-loadadr.patch" - if [ "${INSTALL_TSAN}" = "yes" ] then # Add ThreadSanitier to the installation. diff --git a/tools/valgrind/memcheck_analyze.py b/tools/valgrind/memcheck_analyze.py index 8e7e563..15fe68c 100755 --- a/tools/valgrind/memcheck_analyze.py +++ b/tools/valgrind/memcheck_analyze.py @@ -31,10 +31,10 @@ def _GdbOutputToFileLine(output_line): else: return None -def ResolveAddressesWithinABinary(binary_name, load_address, address_list): +def ResolveAddressesWithinABinary(binary_name, address_list): ''' For each address, return a pair (file, line num) ''' commands = tempfile.NamedTemporaryFile() - commands.write('add-symbol-file "%s" %s\n' % (binary_name, load_address)) + commands.write('file %s\n' % binary_name) for addr in address_list: commands.write('info line *%s\n' % addr) commands.write('quit\n') @@ -59,18 +59,11 @@ def ResolveAddressesWithinABinary(binary_name, load_address, address_list): class _AddressTable(object): ''' Object to do batched line number lookup. ''' def __init__(self): - self._load_addresses = {} self._binaries = {} self._all_resolved = False - def AddBinaryAt(self, binary, load_address): - ''' Register a new shared library or executable. ''' - self._load_addresses[binary] = load_address - def Add(self, binary, address): ''' Register a lookup request. ''' - if binary == '': - logging.warn('adding address %s in empty binary?' % address) if binary in self._binaries: self._binaries[binary].append(address) else: @@ -81,10 +74,8 @@ class _AddressTable(object): ''' Carry out all lookup requests. ''' self._translation = {} for binary in self._binaries.keys(): - if binary != '': - load_address = self._load_addresses[binary] - addr = ResolveAddressesWithinABinary(binary, load_address, self._binaries[binary]) - self._translation[binary] = addr + addr = ResolveAddressesWithinABinary(binary, self._binaries[binary]) + self._translation[binary] = addr self._all_resolved = True def GetFileLine(self, binary, addr): @@ -204,20 +195,13 @@ class ValgrindError: # Each frame looks like this: # <frame> # <ip>0x83751BC</ip> - # <obj>/data/dkegel/chrome-build/src/out/Release/base_unittests</obj> + # <obj>/usr/local/google/bigdata/dkegel/chrome-build/src/out/Release/base_unittests</obj> # <fn>_ZN7testing8internal12TestInfoImpl7RunTestEPNS_8TestInfoE</fn> # <dir>/data/dkegel/chrome-build/src/testing/gtest/src</dir> # <file>gtest-internal-inl.h</file> # <line>655</line> # </frame> - # although the dir, file, and line elements are missing if there is - # no debug info. - # - # With our patch for https://bugs.kde.org/show_bug.cgi?id=205000 in, - # the file also includes records of the form - # <load_obj><obj>/usr/lib/libgcc_s.1.dylib</obj><ip>0x27000</ip></load_obj> - # giving the filename and load address of each binary that was mapped - # into the process. + # although the dir, file, and line elements are missing if there is no debug info. self._kind = getTextOf(error_node, "kind") self._backtraces = [] @@ -355,7 +339,13 @@ class MemcheckAnalyze: if origsize > newsize+1: logging.warn(str(origsize - newsize) + " bytes of junk were after </valgrindoutput> in %s!" % file) try: - parsed_file = parse(file); + raw_errors = parse(file).getElementsByTagName("error") + for raw_error in raw_errors: + # Ignore "possible" leaks for now by default. + if (show_all_leaks or + getTextOf(raw_error, "kind") != "Leak_PossiblyLost"): + error = ValgrindError(source_dir, raw_error) + self._errors.add(error) except ExpatError, e: self._parse_failed = True logging.warn("could not parse %s: %s" % (file, e)) @@ -374,22 +364,6 @@ class MemcheckAnalyze: logging.warn("> %s" % context_data) context_file.close() continue - if TheAddressTable != None: - load_objs = parsed_file.getElementsByTagName("load_obj") - for load_obj in load_objs: - global TheAddressTable - obj = getTextOf(load_obj, "obj") - ip = getTextOf(load_obj, "ip") - TheAddressTable.AddBinaryAt(obj, ip) - - raw_errors = parsed_file.getElementsByTagName("error") - for raw_error in raw_errors: - # Ignore "possible" leaks for now by default. - if (show_all_leaks or - getTextOf(raw_error, "kind") != "Leak_PossiblyLost"): - error = ValgrindError(source_dir, raw_error) - self._errors.add(error) - if len(badfiles) > 0: logging.warn("valgrind didn't finish writing %d files?!" % len(badfiles)) for file in badfiles: diff --git a/tools/valgrind/valgrind_test.py b/tools/valgrind/valgrind_test.py index 14d3076..5160ffe 100755 --- a/tools/valgrind/valgrind_test.py +++ b/tools/valgrind/valgrind_test.py @@ -181,18 +181,6 @@ class ValgrindTool(object): shutil.copyfile(dsym_file, test_command) shutil.copymode(saved_test_command, test_command) - # Make sure the Chromium Framework symbols are available. - # See message from mmentovai on aug 5 - build_dir = os.path.dirname(test_command) - symlink_source = '../../../Chromium Framework.framework.dSYM' - symlink_target = build_dir + '/Chromium.app/Contents/Frameworks/Chromium Framework.framework.dSYM' - try: - os.remove(symlink_target) - except IOError, (errno, strerror): - pass - logging.info('Trying ln -s "%s" "%s"' % (symlink_source, symlink_target)) - os.symlink(symlink_source, symlink_target) - if needs_dsymutil: if self._options.generate_dsym: # Remove the .dSYM bundle if it exists. @@ -376,7 +364,7 @@ class Memcheck(ValgrindTool): filenames = glob.glob(self.TMP_DIR + "/memcheck.*") use_gdb = (sys.platform == 'darwin') - analyzer = memcheck_analyze.MemcheckAnalyze(self._source_dir, filenames, self._options.show_all_leaks, + analyzer = memcheck_analyze.MemcheckAnalyze(self._source_dir, filenames, self._options.show_all_leaks, use_gdb=use_gdb) return analyzer.Report() diff --git a/tools/valgrind/xml-loadadr.patch b/tools/valgrind/xml-loadadr.patch deleted file mode 100644 index a398543..0000000 --- a/tools/valgrind/xml-loadadr.patch +++ /dev/null @@ -1,13 +0,0 @@ -Index: coregrind/m_debuginfo/readmacho.c -=================================================================== ---- coregrind/m_debuginfo/readmacho.c (revision 10771) -+++ coregrind/m_debuginfo/readmacho.c (working copy) -@@ -680,6 +682,8 @@ - if (VG_(clo_verbosity) > 1) - VG_(message)(Vg_DebugMsg, - "%s (%#lx)\n", di->filename, di->rx_map_avma ); -+ if (VG_(clo_xml)) -+ VG_(printf_xml)("<load_obj><obj>%s</obj><ip>%#lx</ip></load_obj>\n", di->filename, di->rx_map_avma); - - /* This should be ensured by our caller. */ - vg_assert(di->have_rx_map); |