Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1150)

Side by Side Diff: tools/mac/show_mod_init_func.py

Issue 2225883002: Invoke atos via xcrun in tools/mac/show_mod_init_func.py. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 2
3 # Copyright 2016 The Chromium Authors. All rights reserved. 3 # Copyright 2016 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 """ 7 """
8 Prints the contents of the __DATA,__mod_init_func section of a Mach-O image. 8 Prints the contents of the __DATA,__mod_init_func section of a Mach-O image.
9 9
10 Usage: 10 Usage:
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 # of the initializer pointer. 47 # of the initializer pointer.
48 # out/gn/Chromium Framework.unstripped: 48 # out/gn/Chromium Framework.unstripped:
49 # Contents of (__DATA,__mod_init_func) section 49 # Contents of (__DATA,__mod_init_func) section
50 # 0x0000000008761498 0x000000000385d120 50 # 0x0000000008761498 0x000000000385d120
51 return [line.split(' ')[1] for line in lines[2:]] 51 return [line.split(' ')[1] for line in lines[2:]]
52 52
53 53
54 def SymbolizeAddresses(binary, addresses): 54 def SymbolizeAddresses(binary, addresses):
55 """Given a |binary| and a list of |addresses|, symbolizes them using atos. 55 """Given a |binary| and a list of |addresses|, symbolizes them using atos.
56 """ 56 """
57 atos = ['atos', '-o', binary] + addresses 57 atos = ['xcrun', 'atos', '-o', binary] + addresses
58 lines = subprocess.check_output(atos).strip().split('\n') 58 lines = subprocess.check_output(atos).strip().split('\n')
59 return lines 59 return lines
60 60
61 61
62 def Main(): 62 def Main():
63 parser = optparse.OptionParser(usage='%prog filename') 63 parser = optparse.OptionParser(usage='%prog filename')
64 opts, args = parser.parse_args() 64 opts, args = parser.parse_args()
65 if len(args) != 1: 65 if len(args) != 1:
66 parser.error('missing binary filename') 66 parser.error('missing binary filename')
67 return 1 67 return 1
68 68
69 ShowModuleInitializers(args[0]) 69 ShowModuleInitializers(args[0])
70 return 0 70 return 0
71 71
72 if __name__ == '__main__': 72 if __name__ == '__main__':
73 sys.exit(Main()) 73 sys.exit(Main())
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698