summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlaforge@chromium.org <laforge@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-24 15:59:18 +0000
committerlaforge@chromium.org <laforge@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-24 15:59:18 +0000
commit33fa2419e70103efc4b9107c20f56c54af4c6906 (patch)
tree6bd6823d7b720aea286c3b0227f6d2c8372c08ee
parent11ec2df3f21dbc2d44e54463f8112b5888ea7dce (diff)
downloadchromium_src-33fa2419e70103efc4b9107c20f56c54af4c6906.zip
chromium_src-33fa2419e70103efc4b9107c20f56c54af4c6906.tar.gz
chromium_src-33fa2419e70103efc4b9107c20f56c54af4c6906.tar.bz2
Merge 219408 "Generate one asan filter per chrome dll target."
> Generate one asan filter per chrome dll target. > > This was preventing the SyzyASan instrumentation of a split build. > > R=chrisha@chromium.org > BUG= > > Review URL: https://chromiumcodereview.appspot.com/22831034 TBR=sebmarchand@chromium.org Review URL: https://codereview.chromium.org/22836007 git-svn-id: svn://svn.chromium.org/chrome/branches/1610/src@219459 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/chrome_syzygy.gypi4
-rwxr-xr-xchrome/tools/build/win/syzygy_instrument.py27
2 files changed, 18 insertions, 13 deletions
diff --git a/chrome/chrome_syzygy.gypi b/chrome/chrome_syzygy.gypi
index 6dbbd34..a3201cc 100644
--- a/chrome/chrome_syzygy.gypi
+++ b/chrome/chrome_syzygy.gypi
@@ -58,7 +58,7 @@
'<(dest_dir)/<(dll_name).dll.pdb',
'<(dest_dir)/asan_rtl.dll',
'<(dest_dir)/asan_rtl.dll.pdb',
- '<(dest_dir)/win-syzyasan-filter.txt.json',
+ '<(dest_dir)/win-syzyasan-filter-<(dll_name).txt.json',
],
'action': [
'python',
@@ -68,6 +68,8 @@
'--input_symbol', '<(PRODUCT_DIR)/<(dll_name).dll.pdb',
'--filter',
'<(DEPTH)/chrome/tools/build/win/win-syzyasan-filter.txt',
+ '--output-filter-file',
+ '<(dest_dir)/win-syzyasan-filter-<(dll_name).txt.json',
'--destination_dir', '<(dest_dir)',
],
},
diff --git a/chrome/tools/build/win/syzygy_instrument.py b/chrome/tools/build/win/syzygy_instrument.py
index 75eaf2d..dfde310 100755
--- a/chrome/tools/build/win/syzygy_instrument.py
+++ b/chrome/tools/build/win/syzygy_instrument.py
@@ -42,12 +42,11 @@ def _Shell(*cmd, **kw):
return stdout, stderr
-def _CompileFilter(syzygy_dir, executable, symbol, dst_dir, filter_file):
+def _CompileFilter(syzygy_dir, executable, symbol, filter_file,
+ output_filter_file):
"""Compiles the provided filter writing the compiled filter file to
- dst_dir. Returns the absolute path of the compiled filter.
+ output_filter_file.
"""
- output_filter_file = os.path.abspath(os.path.join(
- dst_dir, os.path.basename(filter_file) + '.json'))
cmd = [os.path.abspath(os.path.join(syzygy_dir, _GENFILTER_EXE)),
'--action=compile',
'--input-image=%s' % executable,
@@ -59,7 +58,7 @@ def _CompileFilter(syzygy_dir, executable, symbol, dst_dir, filter_file):
_Shell(*cmd)
if not os.path.exists(output_filter_file):
raise RuntimeError('Compiled filter file missing: %s' % output_filter_file)
- return output_filter_file
+ return
def _InstrumentBinary(syzygy_dir, mode, executable, symbol, dst_dir,
@@ -114,13 +113,12 @@ def main(options):
os.makedirs(options.destination_dir)
# Compile the filter if one was provided.
- filter_file = None
if options.filter:
- filter_file = _CompileFilter(options.syzygy_dir,
- options.input_executable,
- options.input_symbol,
- options.destination_dir,
- options.filter)
+ _CompileFilter(options.syzygy_dir,
+ options.input_executable,
+ options.input_symbol,
+ options.filter,
+ options.output_filter_file)
# Instruments the binaries into the destination directory.
_InstrumentBinary(options.syzygy_dir,
@@ -128,7 +126,7 @@ def main(options):
options.input_executable,
options.input_symbol,
options.destination_dir,
- filter_file)
+ options.output_filter_file)
# Copy the agent DLL and PDB to the destination directory.
_CopyAgentDLL(options.agent_dll, options.destination_dir);
@@ -152,6 +150,9 @@ def _ParseOptions():
option_parser.add_option('--filter',
help='An optional filter. This will be compiled and passed to the '
'instrumentation executable.')
+ option_parser.add_option('--output-filter-file',
+ help='The path where the compiled filter will be written. This is '
+ 'required if --filter is specified.')
options, args = option_parser.parse_args()
if not options.mode:
@@ -162,6 +163,8 @@ def _ParseOptions():
option_parser.error('You must provide an input symbol file.')
if not options.destination_dir:
option_parser.error('You must provide a destination directory.')
+ if options.filter and not options.output_filter_file:
+ option_parser.error('You must provide a filter output file.')
if not options.agent_dll:
if not options.mode in _DEFAULT_AGENT_DLLS: