1. What is a symbol table?
The symbol table refers to a . DSYM file that is generated after the Xcode project is compiled and compiled in the same name as the generated binaries in the app 's sibling directory. The . DSYM file is actually a directory in which the subdirectory contains a 16-binary relay file that holds the address mapping information for the function, and all Debug symbols are in this file (including file name, function name, line number, etc.) , so it is also called Debug symbol information file.
Typically, theXcode project generates a new . DSYM file Each time it is compiled. Therefore, each release version of theApp needs to back up a corresponding . DSYM file for subsequent debugging to locate the problem.
Attention:
Each time the project is compiled, the. App and . DSYM appear in pairs, and both have the same UUID value to identify the product of the same compilation.
The UUID value can be checked using dwarfdump-uuid :
$ dwarfdump --uuid XX.app.dSYM
$ dwarfdump --uuid XX.app/XX
2, the role of the symbol table: If the app is released online, developers can not debug, only through the analysis system recorded crash log to locate the problem, in this crash log file, the App will point out the error function memory address, and these function addresses can be in . The DSYM file finds specific filenames, function names, and line number information, which is where the symbolic table plays an important role.
3. How to generate a symbol table:
1. Compile and package with Xcodebuild
After the project is compiled in Xcode , it is generated under the build/configurationname-iphoneos directory under the project directory. App.dsym file.
If you use the xcodebuild command to compile the package, you can specify the storage path for the compiled results, as well as the . App and . App.dsym generation.
In general, we recommend packaging the release, using the xcodebuild compiled packaging, convenient . App and . App.dsym Matching storage, avoid . App.dsym The case of file loss.
2. Archive export using Xcode
If the developer uses Xcode 's Archive export feature to package, you can switch to organizer 's Projects view to see the Derived of the corresponding project Data path where you can find the . App and . App.dsym files that are generated by the current export process.
4: How to use the terminal for. dSYM analysis
$ xcrun atos -o(.dSYM 文件路径) -arch (崩溃架构) -l loadAddress address ...
Description
The loadaddress represents the dynamic load address of the function, corresponding to the address in front of the + sign in the crash address stack, which is 0x000ef000
Address represents the run-time addresses, corresponding to the first address in the stack of crash addresses, that is, 0x0010143b
In fact, the add-on address of the + sign in the crash address stack is the run-time address, i.e. 0x000ef000 + 74808 = 0x0010143b
For example:
Xcrun atos-o/users/user/desktop/jdmobile\ 15-5-28\ pm 6.38.xcarchive/dsyms/jdmobile.app.dsym/contents/ Resources/dwarf/jdmobile-arch arm64-l 0x1000e4000 0x000000010020e118
IOS app crash log symbology and code positioning