Commit 9794e18c authored by earthdok's avatar earthdok Committed by Commit bot

Tweak output of (memcheck|drmemory)_analyze.py.

Wrap error reports in "### (BEGIN|END) MEMORY TOOL REPORT". This will allow us
to extract them with GTestLogParser and use them as snippets.

BUG=453020
R=thestig@chromium.org
NOTRY=true

Review URL: https://codereview.chromium.org/884813002

Cr-Commit-Position: refs/heads/master@{#313572}
parent b956dfdf
......@@ -40,13 +40,18 @@ class DrMemoryError:
self._suppression = "\n".join(supp_lines)
def __str__(self):
output = self._report + "\n"
output = ""
output += "### BEGIN MEMORY TOOL REPORT (error hash=#%016X#)\n" %
self.ErrorHash()
output += self._report + "\n"
if self._testcase:
output += "The report came from the `%s` test.\n" % self._testcase
output += "Suppression (error hash=#%016X#):\n" % self.ErrorHash()
output += (" For more info on using suppressions see "
"http://dev.chromium.org/developers/how-tos/using-drmemory#TOC-Suppressing-error-reports-from-the-\n")
output += "{\n%s\n}\n" % self._suppression
output += "### END MEMORY TOOL REPORT (error hash=#%016X#)\n" %
self.ErrorHash()
return output
# This is a device-independent hash identifying the suppression.
......
......@@ -231,6 +231,9 @@ class ValgrindError:
''' Pretty print the type and backtrace(s) of this specific error,
including suppression (which is just a mangled backtrace).'''
output = ""
output += "\n" # Make sure the ### is at the beginning of line.
output += "### BEGIN MEMORY TOOL REPORT (error hash=#%016X#)\n" %
self.ErrorHash()
if (self._commandline):
output += self._commandline + "\n"
......@@ -327,6 +330,8 @@ class ValgrindError:
supplines[frame] = "*".join(m.groups())
output += "\n".join(supplines) + "\n"
output += "### END MEMORY TOOL REPORT (error hash=#%016X#)\n" %
self.ErrorHash()
return output
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment