Chromium Code Reviews| Index: chrome/tools/build/mac/dump_product_syms |
| diff --git a/chrome/tools/build/mac/dump_product_syms b/chrome/tools/build/mac/dump_product_syms |
| index 3e3d97302316c92ddf1c630d3102d5c2b337b325..d9f1dc15739cfbe3bb4c70581aa5f382b1a12c10 100755 |
| --- a/chrome/tools/build/mac/dump_product_syms |
| +++ b/chrome/tools/build/mac/dump_product_syms |
| @@ -107,6 +107,34 @@ for SRC_NAME in "${SRC_NAMES[@]}"; do |
| DSYM_PATH="${BUILT_PRODUCTS_DIR}/${DSYM_NAME}" |
| DWARF_PATH="${DSYM_PATH}/Contents/Resources/DWARF/${SRC_STEM}" |
| + # SRC_PATH is the path to the Mach-O file to which the DSYM_PATH corresponds. |
| + # If this is a directory, it is a bundle, and the path to the actual image |
| + # needs to be computed for dump_syms. |
| + SRC_PREFIX="${BUILT_PRODUCTS_DIR}/${SRC_NAME}" |
| + SRC_PATH="" |
| + if [[ -d "${SRC_PREFIX}" ]]; then |
| + BUNDLED_OPTIONS=( |
| + # Executables and plugins: |
| + "${SRC_PREFIX}/Contents/MacOS/${SRC_STEM}" |
| + # Frameworks: |
| + "${SRC_PREFIX}/Versions/Current/${SRC_STEM}" |
| + ) |
| + for BUNDLED_OPTION in "${BUNDLED_OPTIONS[@]}"; do |
| + if [[ -e "${BUNDLED_OPTION}" ]]; then |
|
Mark Mentovai
2014/07/25 22:28:43
Use a combination of -f and -x, not -e.
Robert Sesek
2014/07/25 22:37:36
Done.
|
| + SRC_PATH="${BUNDLED_OPTION}" |
| + break |
| + fi |
| + done |
| + |
| + if [[ -z "${SRC_PATH}" ]]; then |
| + echo "${0}: Could not find bundled Mach-O file for ${SRC_NAME}" |
| + exit 1 |
| + fi |
| + else |
| + # The Mach-O file is not a bundle. |
| + SRC_PATH="${SRC_PREFIX}" |
| + fi |
| + |
| ARCHS=$(file "${DWARF_PATH}" | sed -Ene 's/^.*(i386|x86_64)$/\1/p') |
| if [[ -z "${ARCHS}" ]]; then |
| echo "${0}: expected something dumpable in ${DWARF_PATH}" >& 2 |
| @@ -117,12 +145,11 @@ for SRC_NAME in "${SRC_NAMES[@]}"; do |
| BPAD_SYM_NAME="${SRC_NAME}-${FULL_VERSION}-${ARCH}.breakpad" |
| BPAD_SYM_PATH="${BUILT_PRODUCTS_DIR}/${BPAD_SYM_NAME}" |
| - # Only run dump_syms if the file has changed since the last dump. 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 |
| + # Only run dump_syms if the file has changed since the last dump. Use -g |
| + # to dump data from the dSYM and CFI data from the Mach-O library or |
| + # executable. |
| if [ "${DWARF_PATH}" -nt "${BPAD_SYM_PATH}" ] ; then |
|
Mark Mentovai
2014/07/25 22:28:43
You should also check if SRC_PATH is newer than BP
Robert Sesek
2014/07/25 22:37:36
Done.
|
| - "${BREAKPAD_DUMP_SYMS}" -a "${ARCH}" -c "${DWARF_PATH}" > \ |
| + "${BREAKPAD_DUMP_SYMS}" -a "${ARCH}" -g "${DWARF_PATH}" "${SRC_PATH}" > \ |
| "${BPAD_SYM_PATH}" |
| fi |