问题描述
我尝试编译库并使用DWARF with dSYM File"格式获取调试符号.这适用于动态库,但不适用于静态库.
I try to compile library and get debug symbols with "DWARF with dSYM File" format. This works for dynamic but not for static libraries.
XCode快速帮助"说不需要 dSYM 文件,也不会为静态库或目标文件产品创建.[dwarf-with-dsym]"
XCode "Quick help" says that "dSYM file is not needed and will not be created for static library or object file products). [dwarf-with-dsym]"
谁能解释一下为什么?
谢谢
推荐答案
我偶然发现了这个,希望能对此有所启发
I stumbled across this and hope to shed some light on the same
由于静态库并不是真正的可执行文件,它仍将包含其中的符号.所以没有 dSYM 的意义,当这个库又被另一个应用程序使用时,就会有一个 dSYM 包含应用程序的符号和你的静态框架的符号.
Since a static library is not really an executable it will still contain the symbols in it. So there is no point of a dSYM, when this library will in turn used by another application then there will be a dSYM containing the symbols of the application and the symbols of your static framework.
另一方面,动态框架本身就是一个可执行文件,因为它已准备好加载到应用程序中,并且已经在其上进行了链接.因此,您的库中的所有符号都已转换为机器代码,但是有一个 dSYM 将包含您的符号的映射.
Dynamic framework on the other hand is an executable in itself in the sense that it is ready to be loaded into an application and linking has already happened on it. So all the symbols of your library have been converted into machine code already, but there is a dSYM which will contain the mapping of your symbols.
为像我这样的可怜人添加了这个,如果我需要进一步解释,请联系我.
Added this for some poor soul like me, lmk if I need to explain this further.
这篇关于为什么Xcode不为静态库生成dSYM的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!