[email protected] | a6a53d0 | 2009-06-12 17:19:16 | [diff] [blame] | 1 | #!/bin/sh |
2 | |||||
[email protected] | 66e6560a | 2010-04-06 16:54:40 | [diff] [blame] | 3 | # Copyright (c) 2010 The Chromium Authors. All rights reserved. |
[email protected] | a6a53d0 | 2009-06-12 17:19:16 | [diff] [blame] | 4 | # Use of this source code is governed by a BSD-style license that can be |
5 | # found in the LICENSE file. | ||||
6 | # | ||||
[email protected] | 66e6560a | 2010-04-06 16:54:40 | [diff] [blame] | 7 | # Helper script to run dump_syms on Chrome Linux executables and strip |
8 | # them if needed. | ||||
[email protected] | a6a53d0 | 2009-06-12 17:19:16 | [diff] [blame] | 9 | |
10 | set -e | ||||
11 | |||||
12 | usage() { | ||||
[email protected] | 05cb696 | 2009-10-01 23:29:03 | [diff] [blame] | 13 | echo -n "$0 <dump_syms_exe> <strip_binary> " >&2 |
14 | echo "<binary_with_symbols> <symbols_output>" >&2 | ||||
[email protected] | a6a53d0 | 2009-06-12 17:19:16 | [diff] [blame] | 15 | } |
16 | |||||
17 | |||||
[email protected] | 05cb696 | 2009-10-01 23:29:03 | [diff] [blame] | 18 | if [ $# -ne 4 ]; then |
[email protected] | a6a53d0 | 2009-06-12 17:19:16 | [diff] [blame] | 19 | usage |
20 | exit 1 | ||||
21 | fi | ||||
22 | |||||
23 | SCRIPTDIR="$(readlink -f "$(dirname "$0")")" | ||||
24 | DUMPSYMS="$1" | ||||
[email protected] | 66e6560a | 2010-04-06 16:54:40 | [diff] [blame] | 25 | STRIP_BINARY="$2" |
[email protected] | 05cb696 | 2009-10-01 23:29:03 | [diff] [blame] | 26 | INFILE="$3" |
27 | OUTFILE="$4" | ||||
[email protected] | a6a53d0 | 2009-06-12 17:19:16 | [diff] [blame] | 28 | |
[email protected] | a6a53d0 | 2009-06-12 17:19:16 | [diff] [blame] | 29 | # Dump the symbols from the given binary. |
[email protected] | 437bf947 | 2009-06-17 21:50:23 | [diff] [blame] | 30 | if [ ! -e "$OUTFILE" -o "$INFILE" -nt "$OUTFILE" ]; then |
[email protected] | c251248 | 2009-06-12 19:21:20 | [diff] [blame] | 31 | "$DUMPSYMS" "$INFILE" > "$OUTFILE" |
32 | fi | ||||
[email protected] | a6a53d0 | 2009-06-12 17:19:16 | [diff] [blame] | 33 | |
[email protected] | 66e6560a | 2010-04-06 16:54:40 | [diff] [blame] | 34 | if [ "$STRIP_BINARY" != "0" ]; then |
35 | strip "$INFILE" | ||||
[email protected] | 05cb696 | 2009-10-01 23:29:03 | [diff] [blame] | 36 | fi |