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

Side by Side Diff: tools/find_runtime_symbols/prepare_symbol_info.py

Issue 13470029: Change the format of reduce_debugline.py. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressed the comments Created 7 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | tools/find_runtime_symbols/reduce_debugline.py » ('j') | 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 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 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 import json 6 import json
7 import logging 7 import logging
8 import os 8 import os
9 import re 9 import re
10 import shutil 10 import shutil
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 nm_filename = _dump_command_result( 142 nm_filename = _dump_command_result(
143 'nm -n --format bsd %s | c++filt' % entry.name, 143 'nm -n --format bsd %s | c++filt' % entry.name,
144 output_dir_path, os.path.basename(entry.name), '.nm') 144 output_dir_path, os.path.basename(entry.name), '.nm')
145 if not nm_filename: 145 if not nm_filename:
146 continue 146 continue
147 readelf_e_filename = _dump_command_result( 147 readelf_e_filename = _dump_command_result(
148 'readelf -eW %s' % entry.name, 148 'readelf -eW %s' % entry.name,
149 output_dir_path, os.path.basename(entry.name), '.readelf-e') 149 output_dir_path, os.path.basename(entry.name), '.readelf-e')
150 if not readelf_e_filename: 150 if not readelf_e_filename:
151 continue 151 continue
152 readelf_reduced_debugline_filename = None 152 readelf_debug_decodedline_file = None
153 if use_source_file_name: 153 if use_source_file_name:
154 readelf_reduced_debugline_filename = _dump_command_result( 154 readelf_debug_decodedline_file = _dump_command_result(
155 'readelf -wLW %s | %s' % (entry.name, REDUCE_DEBUGLINE_PATH), 155 'readelf -wL %s | %s' % (entry.name, REDUCE_DEBUGLINE_PATH),
156 output_dir_path, os.path.basename(entry.name), '.readelf-debugline') 156 output_dir_path, os.path.basename(entry.name), '.readelf-wL')
157 157
158 files[entry.name] = {} 158 files[entry.name] = {}
159 files[entry.name]['nm'] = { 159 files[entry.name]['nm'] = {
160 'file': os.path.basename(nm_filename), 160 'file': os.path.basename(nm_filename),
161 'format': 'bsd', 161 'format': 'bsd',
162 'mangled': False} 162 'mangled': False}
163 files[entry.name]['readelf-e'] = { 163 files[entry.name]['readelf-e'] = {
164 'file': os.path.basename(readelf_e_filename)} 164 'file': os.path.basename(readelf_e_filename)}
165 if readelf_reduced_debugline_filename: 165 if readelf_debug_decodedline_file:
166 files[entry.name]['readelf-reduced-debugline'] = { 166 files[entry.name]['readelf-debug-decodedline-file'] = {
167 'file': os.path.basename(readelf_reduced_debugline_filename)} 167 'file': os.path.basename(readelf_debug_decodedline_file)}
168 168
169 with open(os.path.join(output_dir_path, 'files.json'), 'w') as f: 169 with open(os.path.join(output_dir_path, 'files.json'), 'w') as f:
170 json.dump(files, f, indent=2, sort_keys=True) 170 json.dump(files, f, indent=2, sort_keys=True)
171 171
172 LOGGER.info('Collected symbol information at "%s".' % output_dir_path) 172 LOGGER.info('Collected symbol information at "%s".' % output_dir_path)
173 return output_dir_path, used_tempdir 173 return output_dir_path, used_tempdir
174 174
175 175
176 def main(): 176 def main():
177 if not sys.platform.startswith('linux'): 177 if not sys.platform.startswith('linux'):
(...skipping 15 matching lines...) Expand all
193 elif len(sys.argv) == 2: 193 elif len(sys.argv) == 2:
194 result, _ = prepare_symbol_info(sys.argv[1]) 194 result, _ = prepare_symbol_info(sys.argv[1])
195 else: 195 else:
196 result, _ = prepare_symbol_info(sys.argv[1], sys.argv[2]) 196 result, _ = prepare_symbol_info(sys.argv[1], sys.argv[2])
197 197
198 return not result 198 return not result
199 199
200 200
201 if __name__ == '__main__': 201 if __name__ == '__main__':
202 sys.exit(main()) 202 sys.exit(main())
OLDNEW
« no previous file with comments | « no previous file | tools/find_runtime_symbols/reduce_debugline.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698