1

My OSX app has several dependency libraries which were compiled with -g clang flag to preserve source-level debug symbols. Xcode project settings have Strip Debug Symbols During Copy set to YES and Debug Information Format set to DWARF with dSYM.

However, whenever I read a symbolicated crash report, the backtrace frames on the app-level are correctly symbolicated but library-level frames are just memory addresses. This makes me think that Xcode did not put dependencies' symbols data into dSYM package. How one could fix that?

peetonn
  • 2,942
  • 4
  • 32
  • 49

1 Answers1

0

I've figured out the problem. One should use dsymutil to extract dSYM package from an arbitrary binary compiled with source-level symbols (-g flag for clang on OSX).

I wrote this script to automatically extract dSYMs from my dependencies and place them into the Archive and added it to the Post-build action of the Archive stage in project configuration:

log="/tmp/${FULL_PRODUCT_NAME}-release.log"
echo "********* Adding dependencies dSYMs into the archive..." > $log
function copyLibDsym()
{
    local lib=$1
    local libfile=$(basename $lib)
    local libname="${libfile%.*}"
    echo "extracting dSYMs from ${libname} to ${ARCHIVE_DSYMS_PATH}/${libname}.dSYM" >> $log
    dsymutil "$lib" -o "${ARCHIVE_DSYMS_PATH}/${libname}.dSYM"
}

ndnrtclib="${NDNRTC_LIB_PATH}/libndnrtc.dylib"
ndncpplib="${NDNCPP_LIB_PATH}/libndn-cpp.dylib"
discoverylib="${NDNCHAT_LIB_PATH}/libentity-discovery.dylib"
chatlib="${NDNCHAT_LIB_PATH}/libchrono-chat2013.dylib"

copyLibDsym $ndnrtclib
copyLibDsym $ndncpplib
copyLibDsym $discoverylib
copyLibDsym $chatlib

Archive's dSYMs folder now have several .dSYM packages which can be used for proper crash reports symbolication.

peetonn
  • 2,942
  • 4
  • 32
  • 49