2009-06-12 21:19:16 +04:00
|
|
|
#!/bin/sh
|
|
|
|
|
2010-04-06 20:54:40 +04:00
|
|
|
# Copyright (c) 2010 The Chromium Authors. All rights reserved.
|
2009-06-12 21:19:16 +04:00
|
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
|
|
# found in the LICENSE file.
|
|
|
|
#
|
2010-04-06 20:54:40 +04:00
|
|
|
# Helper script to run dump_syms on Chrome Linux executables and strip
|
|
|
|
# them if needed.
|
2009-06-12 21:19:16 +04:00
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
usage() {
|
2009-10-02 03:29:03 +04:00
|
|
|
echo -n "$0 <dump_syms_exe> <strip_binary> " >&2
|
|
|
|
echo "<binary_with_symbols> <symbols_output>" >&2
|
2009-06-12 21:19:16 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-10-02 03:29:03 +04:00
|
|
|
if [ $# -ne 4 ]; then
|
2009-06-12 21:19:16 +04:00
|
|
|
usage
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
SCRIPTDIR="$(readlink -f "$(dirname "$0")")"
|
|
|
|
DUMPSYMS="$1"
|
2010-04-06 20:54:40 +04:00
|
|
|
STRIP_BINARY="$2"
|
2009-10-02 03:29:03 +04:00
|
|
|
INFILE="$3"
|
|
|
|
OUTFILE="$4"
|
2009-06-12 21:19:16 +04:00
|
|
|
|
|
|
|
# Dump the symbols from the given binary.
|
2009-06-18 01:50:23 +04:00
|
|
|
if [ ! -e "$OUTFILE" -o "$INFILE" -nt "$OUTFILE" ]; then
|
2013-05-08 01:25:03 +04:00
|
|
|
"$DUMPSYMS" -r "$INFILE" > "$OUTFILE"
|
2009-06-12 23:21:20 +04:00
|
|
|
fi
|
2009-06-12 21:19:16 +04:00
|
|
|
|
2010-04-06 20:54:40 +04:00
|
|
|
if [ "$STRIP_BINARY" != "0" ]; then
|
|
|
|
strip "$INFILE"
|
2009-10-02 03:29:03 +04:00
|
|
|
fi
|