dump_app_syms 737 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #!/bin/sh
  2. # Copyright (c) 2010 The Chromium Authors. All rights reserved.
  3. # Use of this source code is governed by a BSD-style license that can be
  4. # found in the LICENSE file.
  5. #
  6. # Helper script to run dump_syms on Chrome Linux executables and strip
  7. # them if needed.
  8. set -e
  9. usage() {
  10. echo -n "$0 <dump_syms_exe> <strip_binary> " >&2
  11. echo "<binary_with_symbols> <symbols_output>" >&2
  12. }
  13. if [ $# -ne 4 ]; then
  14. usage
  15. exit 1
  16. fi
  17. SCRIPTDIR="$(readlink -f "$(dirname "$0")")"
  18. DUMPSYMS="$1"
  19. STRIP_BINARY="$2"
  20. INFILE="$3"
  21. OUTFILE="$4"
  22. # Dump the symbols from the given binary.
  23. if [ ! -e "$OUTFILE" -o "$INFILE" -nt "$OUTFILE" ]; then
  24. "$DUMPSYMS" "$INFILE" > "$OUTFILE"
  25. fi
  26. if [ "$STRIP_BINARY" != "0" ]; then
  27. strip "$INFILE"
  28. fi