summaryrefslogtreecommitdiffstats
path: root/remoting/scripts/mac/dump_product_syms
blob: cc54a97d629da105c411ea7e7f44895db58db658 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash

# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

set -eu

if [[ "$#" -ne 3 ]]; then
  echo "$0 <dump_syms_tool> <mac_bundle> <breakpad_symbols>" >&2
  exit 1
fi

DUMP_SYMS_TOOL="$1"
SOURCE_BUNDLE="$2"
BREAKPAD_SYMBOLS="$3"

ARCH="i386"

# Filename of bundle, minus the file extension.
STEM="$(basename "${SOURCE_BUNDLE%.*}")"
DWARF_PATH="${SOURCE_BUNDLE}.dSYM/Contents/Resources/DWARF/${STEM}"

# Use -c to avoid dumping CFI, because the Breakpad stackwalk is incompatible
# with CFI produced by clang.
# http://code.google.com/p/google-breakpad/issues/detail?id=443
"${DUMP_SYMS_TOOL}" -a "${ARCH}" -c "${DWARF_PATH}" > "${BREAKPAD_SYMBOLS}"