1 # Copyright 2015 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
5 # Helper script to run dump_syms on Chrome Linux executables and strip
12 if len(sys
.argv
) != 5:
13 print "dump_app_syms.py <dump_syms_exe> <strip_binary>"
14 print " <binary_with_symbols> <symbols_output>"
17 dumpsyms
= sys
.argv
[1]
18 strip_binary
= sys
.argv
[2]
22 # Dump only when the output file is out-of-date.
23 if not os
.path
.isfile(outfile
) or \
24 os
.stat(outfile
).st_mtime
> os
.stat(infile
).st_mtime
:
25 with
open(outfile
, 'w') as outfileobj
:
26 subprocess
.check_call([dumpsyms
, '-r', infile
], stdout
=outfileobj
)
28 if strip_binary
!= '0':
29 subprocess
.check_call(['strip', infile
])