I'm using CMake on MacOS to generate Makefiles for my C++ project. When I build a target (say, test/AsyncTest
), I get that target, plus a test/AsyncTest.dSYM/
directory that contains the following:
test/AsyncTest.dSYM/Contents/Resources/DWARF/AsyncTest
test/AsyncTest.dSYM/Contents/Info.plist
I'm guessing this is debug information (based on the ".dSYM" and the "DWARF" clues), but I haven't found a tool that lets me inspect the AsyncTest file. dwarfdump
doesn't recognize it.
So, what exactly is this file? Is there a tool I can use to dump the symbolic information (assuming that's what it is)? Why is CMake generating it when I didn't ask it to? And can I not generate it (since the resulting file is huuuuge)?
A dSYM file is an ELF file that contains DWARF (debugging with attributed record formats) debug information for your application. DWARF is a debugging file format that supports source-level debugging.
You can open a DSYM file with Xcode by right-clicking the file and selecting "Show Package Contents". Another type of DSYM file contains geometric data written in Geometric Description Language to define a 2D or 3D model in ArchiCAD computer-aided design software.
Debug builds of an app place the debug symbols inside the compiled binary file by default, while release builds of an app place the debug symbols in a companion Debug Symbol file ( dSYM ) to reduce the size of the distributed app.
dSYM file automatically for you when you use the Archive option. The created archive contains your app and its dSYM and is stored in ~/Library/Developer/xcode/Archives .
macOS / OS X / Darwin / Mach-O objects has a "separated debug" scheme by default.
when an exe is linked, the static linker (ld64) does not include the debug data in the exe.
However, the static linker records (in the exe symbol table) the names of the object files that it linked
A second tool (debug linker, named dsymutil) consumes the exe file table and the original objects and links the debug - producing a standard mach-o package structure containing the linked debug. [by default name.dSYM] where "name" is the name of the exe.
LLDB and some versions of GDB can consume this package to provide the debug data they need.
to look at the content :
The Xcode “dwarfdump” utility can understand the package (dwarfdump name.dSYM).
The actual content: name.dSYM/Contents/Resources/DWARF/name should also be dumpable by:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With