OLD | NEW |
1 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 """Runs an exe through Valgrind and puts the intermediate files in a | 5 """Runs an exe through Valgrind and puts the intermediate files in a |
6 directory. | 6 directory. |
7 """ | 7 """ |
8 | 8 |
9 import datetime | 9 import datetime |
10 import glob | 10 import glob |
(...skipping 1089 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1100 | 1100 |
1101 More information at | 1101 More information at |
1102 http://dev.chromium.org/developers/testing/addresssanitizer | 1102 http://dev.chromium.org/developers/testing/addresssanitizer |
1103 """ | 1103 """ |
1104 def __init__(self): | 1104 def __init__(self): |
1105 super(Asan, self).__init__() | 1105 super(Asan, self).__init__() |
1106 self._timeout = 1200 | 1106 self._timeout = 1200 |
1107 if common.IsMac(): | 1107 if common.IsMac(): |
1108 self._env["DYLD_NO_PIE"] = "1" | 1108 self._env["DYLD_NO_PIE"] = "1" |
1109 | 1109 |
| 1110 |
1110 def ToolName(self): | 1111 def ToolName(self): |
1111 return "asan" | 1112 return "asan" |
1112 | 1113 |
1113 def ToolCommand(self): | 1114 def ToolCommand(self): |
1114 # TODO(glider): use pipes instead of the ugly wrapper here once they | 1115 # TODO(glider): use pipes instead of the ugly wrapper here once they |
1115 # are supported. | 1116 # are supported. |
1116 procs = [os.path.join(self._source_dir, "tools", "valgrind", | 1117 procs = [os.path.join(self._source_dir, "tools", "valgrind", |
1117 "asan", "asan_wrapper.sh")] | 1118 "asan", "asan_wrapper.sh")] |
1118 procs.extend(self._args) | 1119 procs.extend(self._args) |
1119 return procs | 1120 return procs |
(...skipping 15 matching lines...) Expand all Loading... |
1135 def ExtendOptionParser(self, parser): | 1136 def ExtendOptionParser(self, parser): |
1136 parser.add_option("", "--suppressions", default=[], | 1137 parser.add_option("", "--suppressions", default=[], |
1137 action="append", | 1138 action="append", |
1138 help="path to TSan suppression file") | 1139 help="path to TSan suppression file") |
1139 | 1140 |
1140 def Setup(self, args): | 1141 def Setup(self, args): |
1141 if not super(TsanGcc, self).Setup(args): | 1142 if not super(TsanGcc, self).Setup(args): |
1142 return False | 1143 return False |
1143 ld_library_paths = [] | 1144 ld_library_paths = [] |
1144 for tail in "lib32", "lib64": | 1145 for tail in "lib32", "lib64": |
1145 ld_library_paths.append(os.path.join(self._source_dir, "third_party", | 1146 ld_library_paths.append( |
1146 "compiler-tsan", "gcc-4.5.3", tail)) | 1147 os.path.join(self._source_dir, "third_party", |
| 1148 "compiler-tsan", "gcc-current", tail)) |
1147 # LD_LIBRARY_PATH will be overriden. | 1149 # LD_LIBRARY_PATH will be overriden. |
1148 self._env["LD_LIBRARY_PATH"] = ":".join(ld_library_paths) | 1150 self._env["LD_LIBRARY_PATH"] = ":".join(ld_library_paths) |
1149 | 1151 |
1150 # TODO(glider): this is a temporary solution until Analyze is implemented. | 1152 # TODO(glider): this is a temporary solution until Analyze is implemented. |
1151 env_options = ["--error-exitcode=1"] | 1153 env_options = ["--error-exitcode=1"] |
1152 # TODO(glider): merge this with other TSan suppressions code. | 1154 # TODO(glider): merge this with other TSan suppressions code. |
1153 suppression_count = 0 | 1155 suppression_count = 0 |
1154 for suppression_file in self._options.suppressions: | 1156 for suppression_file in self._options.suppressions: |
1155 if os.path.exists(suppression_file): | 1157 if os.path.exists(suppression_file): |
1156 suppression_count += 1 | 1158 suppression_count += 1 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1195 return Asan() | 1197 return Asan() |
1196 try: | 1198 try: |
1197 platform_name = common.PlatformNames()[0] | 1199 platform_name = common.PlatformNames()[0] |
1198 except common.NotImplementedError: | 1200 except common.NotImplementedError: |
1199 platform_name = sys.platform + "(Unknown)" | 1201 platform_name = sys.platform + "(Unknown)" |
1200 raise RuntimeError, "Unknown tool (tool=%s, platform=%s)" % (tool_name, | 1202 raise RuntimeError, "Unknown tool (tool=%s, platform=%s)" % (tool_name, |
1201 platform_name) | 1203 platform_name) |
1202 | 1204 |
1203 def CreateTool(tool): | 1205 def CreateTool(tool): |
1204 return ToolFactory().Create(tool) | 1206 return ToolFactory().Create(tool) |
OLD | NEW |