Question

Update: I posted a comment on John Robbins blog about the. He wrote a response here:

http://www.wintellect.com/CS/blogs/jrobbins/archive/2009/06/19/do-pdb-files-affect-performance.aspx

The project I am working on does not build symbols for its release binaries, and I would like to change this.

Some info:

  • Mostly C++ code base, some C#.
  • Compiled under VS2k5, will be moving to VS2k8 Team System.
  • Time critical software.
  • Must have optimizations enabled.
  • Source code is provided to customer so full symbols are fine.

What are the best command line switches to generate what I need, and what, if any, performance hits am I going to take?

Also, are there any "Gotchas" to be aware of?

Was it helpful?

Solution 3

Update: I posted a comment on John Robbins blog about the. He wrote a response here:

http://www.wintellect.com/CS/blogs/jrobbins/archive/2009/06/19/do-pdb-files-affect-performance.aspx

I found the following link on microsofts website: Generating and Deploying Debug Symbols with Microsoft Visual C++ 6.0

This link pertains to Visual C++ 6, but I am assuming these instructions are the same for Visual C++ 8(2005) and 9(2008).

The information it gives is very similar to the link provided by TheBlack but more in-depth.

OTHER TIPS

Generating debug symbols (ie PDB files) is just creating an external file that a debugger can reference when looking at your code in memory. It doesn't affect the code that the compiler or linker generate (sort of like generating a .MAP file).

Now if you're talking about defining _DEBUG in a release build, that's a whole different question.

The /Zi switch in Visual C++ will create a PDB, but this setting also implies additional settings that will make the DLL or EXE larger. Specifically, /Zi implies /DEBUG, which implies /INCREMENTAL, /OPT:NOREF and /OPT:NOICF. The last three make the compiled DLL or EXE bigger, but they can be overridden by specifying /OPT:REF and /OPT:ICF in addition to /Zi. There is no need to override /INCREMENTAL, as /OPT:REF and/or /OPT:ICF will ensure a full, non-incremental link.

Source: Correctly Creating Native C++ Release Build PDBs

I don't know the command line, but you need to set debug symbols both in c++ compiler config (program database) and the linker (generate debug info) in the IDE.

If you find the settings in the project, you can use help to see which command-lines they refer to.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top