Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

c#

vb.net

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"?

like image 331
Jonathan Allen Avatar asked Jan 14 '09 01:01

Jonathan Allen


People also ask

What is meant by debug info?

Debug information is a collection of information that is generated by the C/C++ compiler or assembler program that describes the application for a debugger to use. BAL shared objects (BSOs) and C/C++ shared objects (CSOs) are in executable and linkable format (ELF) object files.

What is debug for in Visual Basic?

In the Visual Studio context, when you debug your app, it usually means that you are running the application with the debugger attached (that is, in debugger mode). When you do this, the debugger provides many ways to see what your code is doing while it runs.

What does debugging do in Visual Studio?

The Visual Studio debugger helps you observe the run-time behavior of your program and find problems.

How do I create a debug file?

To create a run/debug configuration for an item in your project, follow these steps: Open a project in Android or Project view. In the Project window, right-click a testable item and select either Run filename or Debug filename . Android Studio creates a temporary run/debug configuration and launches your app.


2 Answers

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

like image 60
Nathan W Avatar answered Sep 22 '22 09:09

Nathan W


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

Also see https://docs.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.

like image 29
Stefan Avatar answered Sep 24 '22 09:09

Stefan