21

What does "Generate Debug Info" mean in VB/C#?

The difference between "none" and "pdb-only" only is pretty clear. But what about "pdb-only" and "full"?

Jonathan Allen
  • 68,373
  • 70
  • 259
  • 447

2 Answers2

22

The compiler will generate a pdb file for you when you build which contains the symbols for your application and can be used by the Visual Studio debugger and external debuggers to find where something went wrong easily.

"Full" means that full debugging information will be generated when you build your application, so the code itself will be debuggable which includes the [DebuggableAttribute] which links the code to the debugging information, e.g. symbols.

"pdb-only" means that only the pdb debugging information will be generated on build, which will not add the [DebuggableAttribute] to the compiled code which is used by the JIT compiler to link the code the debugging information.

More info can be found here

Nacimota
  • 22,395
  • 6
  • 42
  • 44
Nathan W
  • 54,475
  • 27
  • 99
  • 146
  • 3
    Unfortunately the link is dead. – Daniel Rose Mar 29 '12 at 06:34
  • @Nathan I am able to observe that DebuggableAttribute is added into meta data for both debug:full or pdb-only switches. It represents a union of bitwise DebuggingModes flag which has following values: IgnoreSymbolStoreSequencePoints,EnableEditAndContinue,DisableOptimizations. Value of DebuggableAttribute flag for all 4 combinations in VS 2010 : full & optimize-(01 00 07 01 00 00 00 00) full & optimize+(01 00 03 00 00 00 00 00) pdb-only & optimize+(01 00 02 00 00 00 00 00) pdb-only & optimize-(01 00 02 01 00 00 00 00) – RBT Jan 15 '15 at 01:13
1

From Should I compile release builds with debug info as "full" or "pdb-only"?

Also see https://learn.microsoft.com/en-us/cpp/build/reference/debug-generate-debug-info

I would build with pdb-only. You will not be able to attach a debugger to the released product, but if you get a crash dump, you can use Visual Studio or WinDBG to examine the stack traces and memory dumps at the time of the crash.

If you go with full rather than pdb-only, you'll get the same benefits, except that the executable can be attached directly to a debugger. You'll need to determine if this is reasonable given your product & customers.

Stefan
  • 10,010
  • 7
  • 61
  • 117