问题
On OSX when you link a binary from multiple object files like this
clang++ -g myfile.cpp -o myfile.o
clang++ myfile.o -shared -o myfile.dylib
it will generate a .debug_info
section (etc.) in myfile.o
but in myfile.dylib
it just stores a reference to myfile.o
and you have to run dsymutil myfile.dylib
manually. dsymutil
links all the .debug_info
sections from the object files together and stores them in a myfile.dylib.dSYM
bundle.
My question is: is there a way to make Clang actually link the debug info during compilation and store it directly in myfile.dylib
?
Or if that is not possible, is it possible to embed the .dSYM
bundle inside the .dylib
after it has been generated?
来源:https://stackoverflow.com/questions/49083800/clang-link-debug-info-in-executable-on-osx