3 # Copyright 2014 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file.
7 "This script is used to run obj_int_extract and output the result to a file."
13 parser = optparse.OptionParser()
14 parser.description = __doc__
15 parser.add_option('-e', '--executable', help='path to obj_int_extract.')
16 parser.add_option('-f', '--format', help='binary format (gas or rvds).')
17 parser.add_option('-b', '--binary', help='path to binary to parse.')
18 parser.add_option('-o', '--output', help='path to write extracted output to.')
21 options, args = parser.parse_args()
22 if (not options.executable or not options.format or not options.binary or
24 parser.error('Must specify all four arguments.')
27 with open(options.output, 'w') as fh:
28 subprocess.check_call([options.executable, options.format, options.binary],