What's the correct configuration to make a privately symbolicatable release build in Visual Studio? I want to generate and store a PDB file which would allow me to symbolicate crash dumps of the built executable, but to avoid embedding debug information in the executable itself which would allow an external user to observe symbols, e.g., function and variable names, without the PDB.
I'm used to the DWARF debugging format, which can either be embedded in an executable or be exported to a separate dSYM file, which seems to be the rough equivalent of a PDB; I'm not sure whether or not Visual Studio has the similar option of ever/sometimes embedding the debug information similarly or not in the executable, and if it does, what configuration options I need to turn on to make sure a release build doesn't embed this information.
The /Z7, /Zi, /ZI (Debug Information Format) compiler options allow you to
select the type of debugging information created for your program and whether this information is kept in object (.obj) files or in a program database (PDB).
Both /Zi
as well as /ZI
store debugging information in a program database. None of the information will be compiled into the final executable image.
Since you plan to use the debugging information for analyzing crash dumps of (presumably) release builds, make sure the /Zo (Enhance Optimized Debugging) compiler option is also enabled.