OLD | NEW |
---|---|
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2013 The Chromium Authors. All rights reserved. | 2 # Copyright 2013 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """A tool to generate symbols for a binary suitable for breakpad. | 6 """A tool to generate symbols for a binary suitable for breakpad. |
7 | 7 |
8 Currently, the tool only supports Linux, Android, and Mac. Support for other | 8 Currently, the tool only supports Linux, Android, and Mac. Support for other |
9 platforms is planned. | 9 platforms is planned. |
10 """ | 10 """ |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
171 if os.path.isdir(output_path): | 171 if os.path.isdir(output_path): |
172 os.utime(output_path, None) | 172 os.utime(output_path, None) |
173 | 173 |
174 syms = GetCommandOutput([GetDumpSymsBinary(options.build_dir), '-r', | 174 syms = GetCommandOutput([GetDumpSymsBinary(options.build_dir), '-r', |
175 binary]) | 175 binary]) |
176 module_line = re.match("MODULE [^ ]+ [^ ]+ ([0-9A-F]+) (.*)\n", syms) | 176 module_line = re.match("MODULE [^ ]+ [^ ]+ ([0-9A-F]+) (.*)\n", syms) |
177 output_path = os.path.join(options.symbols_dir, module_line.group(2), | 177 output_path = os.path.join(options.symbols_dir, module_line.group(2), |
178 module_line.group(1)) | 178 module_line.group(1)) |
179 mkdir_p(output_path) | 179 mkdir_p(output_path) |
180 symbol_file = "%s.sym" % module_line.group(2) | 180 symbol_file = "%s.sym" % module_line.group(2) |
181 f = open(os.path.join(output_path, symbol_file), 'w') | 181 try: |
182 f.write(syms) | 182 f = open(os.path.join(output_path, symbol_file), 'w') |
183 f.close() | 183 f.write(syms) |
184 f.close() | |
185 except: | |
186 # Not much we can do about this. | |
Lei Zhang
2014/05/23 03:02:32
Log an error at least?
| |
187 pass | |
184 | 188 |
185 queue.task_done() | 189 queue.task_done() |
186 | 190 |
187 for binary in binaries: | 191 for binary in binaries: |
188 queue.put(binary) | 192 queue.put(binary) |
189 | 193 |
190 for _ in range(options.jobs): | 194 for _ in range(options.jobs): |
191 t = threading.Thread(target=_Worker) | 195 t = threading.Thread(target=_Worker) |
192 t.daemon = True | 196 t.daemon = True |
193 t.start() | 197 t.start() |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
245 binaries |= new_deps | 249 binaries |= new_deps |
246 queue.extend(list(new_deps)) | 250 queue.extend(list(new_deps)) |
247 | 251 |
248 GenerateSymbols(options, binaries) | 252 GenerateSymbols(options, binaries) |
249 | 253 |
250 return 0 | 254 return 0 |
251 | 255 |
252 | 256 |
253 if '__main__' == __name__: | 257 if '__main__' == __name__: |
254 sys.exit(main()) | 258 sys.exit(main()) |
OLD | NEW |