Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # | 2 # |
| 3 # Copyright 2013 The Chromium Authors. All rights reserved. | 3 # Copyright 2013 The Chromium Authors. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 # | 6 # |
| 7 # Find the most recent tombstone file(s) on all connected devices | 7 # Find the most recent tombstone file(s) on all connected devices |
| 8 # and prints their stacks. | 8 # and prints their stacks. |
| 9 # | 9 # |
| 10 # Assumes tombstone file was created with current symbols. | 10 # Assumes tombstone file was created with current symbols. |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 123 found_abi = re.search('ABI: \'(.+?)\'', line) | 123 found_abi = re.search('ABI: \'(.+?)\'', line) |
| 124 if found_abi: | 124 if found_abi: |
| 125 device_abi = found_abi.group(1) | 125 device_abi = found_abi.group(1) |
| 126 arch = _DeviceAbiToArch(device_abi) | 126 arch = _DeviceAbiToArch(device_abi) |
| 127 if not arch: | 127 if not arch: |
| 128 return | 128 return |
| 129 | 129 |
| 130 stack_tool = os.path.join(os.path.dirname(__file__), '..', '..', | 130 stack_tool = os.path.join(os.path.dirname(__file__), '..', '..', |
| 131 'third_party', 'android_platform', 'development', | 131 'third_party', 'android_platform', 'development', |
| 132 'scripts', 'stack') | 132 'scripts', 'stack') |
| 133 | |
| 133 cmd = [stack_tool, '--arch', arch, '--output-directory', | 134 cmd = [stack_tool, '--arch', arch, '--output-directory', |
| 134 constants.GetOutDirectory()] | 135 constants.GetOutDirectory()] |
| 136 if os.path.exists(os.path.join(constants.GetOutDirectory(), 'lib')): | |
| 137 for root, _, files in os.walk(os.path.join(constants.GetOutDirectory(), | |
| 138 'lib')): | |
| 139 for file_name in files: | |
| 140 if file_name.endswith('.so'): | |
| 141 cmd.extend(['--packed-lib', os.path.join(root, file_name)]) | |
|
jbudorick
2017/07/12 20:57:28
--packed-lib implies that the library has had its
BigBossZhiling
2017/07/17 06:42:58
unstripped libs will always be there now in isolat
| |
| 135 proc = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE) | 142 proc = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE) |
| 136 output = proc.communicate(input='\n'.join(tombstone_data))[0] | 143 output = proc.communicate(input='\n'.join(tombstone_data))[0] |
| 137 for line in output.split('\n'): | 144 for line in output.split('\n'): |
| 138 if not include_stack and 'Stack Data:' in line: | 145 if not include_stack and 'Stack Data:' in line: |
| 139 break | 146 break |
| 140 yield line | 147 yield line |
| 141 | 148 |
| 142 | 149 |
| 143 def _ResolveTombstone(tombstone): | 150 def _ResolveTombstone(tombstone): |
| 144 lines = [] | 151 lines = [] |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 306 for device in devices: | 313 for device in devices: |
| 307 resolved_tombstones = ResolveTombstones( | 314 resolved_tombstones = ResolveTombstones( |
| 308 device, args.all_tombstones, | 315 device, args.all_tombstones, |
| 309 args.stack, args.wipe_tombstones, args.jobs) | 316 args.stack, args.wipe_tombstones, args.jobs) |
| 310 for line in resolved_tombstones: | 317 for line in resolved_tombstones: |
| 311 logging.info(line) | 318 logging.info(line) |
| 312 | 319 |
| 313 | 320 |
| 314 if __name__ == '__main__': | 321 if __name__ == '__main__': |
| 315 sys.exit(main()) | 322 sys.exit(main()) |
| OLD | NEW |