Chromium Code Reviews| 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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 138 try: | 138 try: |
| 139 os.makedirs(path) | 139 os.makedirs(path) |
| 140 except OSError as e: | 140 except OSError as e: |
| 141 if e.errno == errno.EEXIST and os.path.isdir(path): | 141 if e.errno == errno.EEXIST and os.path.isdir(path): |
| 142 pass | 142 pass |
| 143 else: raise | 143 else: raise |
| 144 | 144 |
| 145 | 145 |
| 146 def GetBinaryInfoFromHeaderInfo(header_info): | 146 def GetBinaryInfoFromHeaderInfo(header_info): |
| 147 """Given a standard symbol header information line, returns BINARY_INFO.""" | 147 """Given a standard symbol header information line, returns BINARY_INFO.""" |
| 148 # header info is of the form "MODULE $PLATFORM $ARCH $HASH $BINARY" | 148 # header info is of the form "MODULE $PLATFORM $ARCH $HASH $BINARY" |
|
jochen (gone - plz use gerrit)
2016/04/14 13:30:09
is the comment still up to date? Can you explain w
David Yen
2016/04/14 16:46:06
I was confused about this too, the max splits is 1
| |
| 149 info_split = header_info.strip().split(' ', 5) | 149 info_split = header_info.strip().split(' ', 4) |
| 150 if len(info_split) != 5 or info_split[0] != 'MODULE': | 150 if len(info_split) != 5 or info_split[0] != 'MODULE': |
|
jochen (gone - plz use gerrit)
2016/04/14 13:30:09
the first condition is now basically always true,
David Yen
2016/04/14 16:46:06
see explanation above
| |
| 151 return None | 151 return None |
| 152 return BINARY_INFO(*info_split[1:]) | 152 return BINARY_INFO(*info_split[1:]) |
| 153 | 153 |
| 154 | 154 |
| 155 def GenerateSymbols(options, binaries): | 155 def GenerateSymbols(options, binaries): |
| 156 """Dumps the symbols of binary and places them in the given directory.""" | 156 """Dumps the symbols of binary and places them in the given directory.""" |
| 157 | 157 |
| 158 queue = Queue.Queue() | 158 queue = Queue.Queue() |
| 159 print_lock = threading.Lock() | 159 print_lock = threading.Lock() |
| 160 | 160 |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 288 binaries |= new_deps | 288 binaries |= new_deps |
| 289 queue.extend(list(new_deps)) | 289 queue.extend(list(new_deps)) |
| 290 | 290 |
| 291 GenerateSymbols(options, binaries) | 291 GenerateSymbols(options, binaries) |
| 292 | 292 |
| 293 return 0 | 293 return 0 |
| 294 | 294 |
| 295 | 295 |
| 296 if '__main__' == __name__: | 296 if '__main__' == __name__: |
| 297 sys.exit(main()) | 297 sys.exit(main()) |
| OLD | NEW |