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

Side by Side Diff: mojo/devtools/common/android_stack_parser/stack

Issue 1312283003: Allow several build directories to be specified to search for symbols (Closed) Base URL: git@github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 3 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
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # 2 #
3 # Copyright (C) 2013 The Android Open Source Project 3 # Copyright (C) 2013 The Android Open Source Project
4 # 4 #
5 # Licensed under the Apache License, Version 2.0 (the "License"); 5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License. 6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at 7 # You may obtain a copy of the License at
8 # 8 #
9 # http://www.apache.org/licenses/LICENSE-2.0 9 # http://www.apache.org/licenses/LICENSE-2.0
10 # 10 #
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 for option, value in options: 92 for option, value in options:
93 if option == "--help": 93 if option == "--help":
94 PrintUsage() 94 PrintUsage()
95 elif option == "--symbols-dir": 95 elif option == "--symbols-dir":
96 symbol.SYMBOLS_DIR = os.path.expanduser(value) 96 symbol.SYMBOLS_DIR = os.path.expanduser(value)
97 elif option == "--symbols-zip": 97 elif option == "--symbols-zip":
98 zip_arg = os.path.expanduser(value) 98 zip_arg = os.path.expanduser(value)
99 elif option == "--arch": 99 elif option == "--arch":
100 symbol.ARCH = value 100 symbol.ARCH = value
101 elif option == "--build-dir": 101 elif option == "--build-dir":
102 symbol.BUILD_DIR = value 102 symbol.BUILD_DIRS = value.split(',')
103 elif option == "--ndk-dir": 103 elif option == "--ndk-dir":
104 symbol.NDK_DIR = value 104 symbol.NDK_DIR = value
105 elif option == "--more-info": 105 elif option == "--more-info":
106 more_info = True 106 more_info = True
107 elif option == "--less-info": 107 elif option == "--less-info":
108 more_info = False 108 more_info = False
109 109
110 if not symbol.BUILD_DIR: 110 if not symbol.BUILD_DIRS:
111 guess = stack_utils.GuessDir(_DEFAULT_BUILD_DIR) 111 guess = stack_utils.GuessDir(_DEFAULT_BUILD_DIR)
112 if not guess: 112 if not guess:
113 print "Couldn't find the build directory, please pass --build-dir." 113 print "Couldn't find the build directory, please pass --build-dir."
114 return 1 114 return 1
115 print "Inferring the build directory path as " + guess 115 print "Inferring the build directory path as " + guess
116 symbol.BUILD_DIR = guess 116 symbol.BUILD_DIRS = [guess]
117 117
118 if not symbol.NDK_DIR: 118 if not symbol.NDK_DIR:
119 guess = stack_utils.GuessDir(_DEFAULT_NDK_DIR) 119 guess = stack_utils.GuessDir(_DEFAULT_NDK_DIR)
120 if not guess: 120 if not guess:
121 print "Couldn't find the Android NDK, please pass --ndk-dir." 121 print "Couldn't find the Android NDK, please pass --ndk-dir."
122 return 1 122 return 1
123 print "Inferring the Android NDK path as " + guess 123 print "Inferring the Android NDK path as " + guess
124 symbol.NDK_DIR = guess 124 symbol.NDK_DIR = guess
125 125
126 126
(...skipping 10 matching lines...) Expand all
137 lines = f.readlines() 137 lines = f.readlines()
138 f.close() 138 f.close()
139 139
140 rootdir = None 140 rootdir = None
141 if zip_arg: 141 if zip_arg:
142 rootdir, symbol.SYMBOLS_DIR = stack_utils.UnzipSymbols(zip_arg) 142 rootdir, symbol.SYMBOLS_DIR = stack_utils.UnzipSymbols(zip_arg)
143 143
144 if symbol.SYMBOLS_DIR: 144 if symbol.SYMBOLS_DIR:
145 print "Reading Android symbols from", symbol.SYMBOLS_DIR 145 print "Reading Android symbols from", symbol.SYMBOLS_DIR
146 146
147 print "Reading Mojo symbols from", symbol.BUILD_DIR 147 print "Reading Mojo symbols from", symbol.BUILD_DIRS
ppi 2015/08/27 15:25:59 Drop "Mojo"?
etiennej 2015/08/27 15:29:54 Done.
148 stack_core.ConvertTrace(lines, more_info, stack_utils.GetSymbolMapping(lines)) 148 stack_core.ConvertTrace(lines, more_info, stack_utils.GetSymbolMapping(lines))
149 149
150 if rootdir: 150 if rootdir:
151 # be a good citizen and clean up...os.rmdir and os.removedirs() don't work 151 # be a good citizen and clean up...os.rmdir and os.removedirs() don't work
152 cmd = "rm -rf \"%s\"" % rootdir 152 cmd = "rm -rf \"%s\"" % rootdir
153 print "\ncleaning up (%s)" % cmd 153 print "\ncleaning up (%s)" % cmd
154 os.system(cmd) 154 os.system(cmd)
155 155
156 if __name__ == "__main__": 156 if __name__ == "__main__":
157 main() 157 main()
158 158
159 # vi: ts=2 sw=2 159 # vi: ts=2 sw=2
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698