Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(253)

Unified Diff: chrome/tools/build/mac/dump_product_syms

Issue 419813005: [Mac] Call dump_syms with the -g flag when building with mac_breakpad=1. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..93829297cb2f54a92b6a136a621bc713d7b77a30 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 [[ -fx "${BUNDLED_OPTION}" ]]; then
+ 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,12 @@ 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
- if [ "${DWARF_PATH}" -nt "${BPAD_SYM_PATH}" ] ; then
- "${BREAKPAD_DUMP_SYMS}" -a "${ARCH}" -c "${DWARF_PATH}" > \
+ # 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}" -o \
+ "${SRC_PATH}" -nt "${BPAD_SYM_PATH}" ] ; then
+ "${BREAKPAD_DUMP_SYMS}" -a "${ARCH}" -g "${DWARF_PATH}" "${SRC_PATH}" > \
"${BPAD_SYM_PATH}"
fi
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698