Why does compiling a VS 2010 project generate pdb files when created in Release and Debug mode?

I am creating my windows 2010 C # project project in Release mode. My first chance to be surprised is that it creates pdb files even in release mode in mode. I could not load debug symbols after attaching the process for debugging.

My question is that if we have pdb files both in debug mode and in release, then why is there a need for two compilation modes.

+6
source share
4 answers

My question is that if we have pdb files both in debug mode and in release, then why is there a need for two compilation modes

There are differences other than PDB generation between debug and release. If you go to the assembly properties and go to "Advanced", different levels of debugging information will be created - Full, PDB only, and None.

In addition, there are different levels of compilation time optimization and the presence of different preprocessor characters (for example, so that each Debug.Assert present or absent).

Of course, you can also have your own build configuration options with various options.

+6
source

There are many reasons why there is a debug / release mode that is not related to creating PDB files.

VS runs compiled programs faster in release mode. In addition, there are compiler directives that can change the way the program works if you are in debug or release mode. For example, you can use compiler directives to disable top-level try catch blocks so that you can isolate the exception that is thrown into a specific line of code.

These are just a few examples. In short, debug mode has many more goals than just creating PDB files for you.

+2
source

You can have more than two compilation modes. Usually, debugging and release means whether you want to optimize or not. Despite this, you can still generate debugging information, only the PDB for building the release will not have much support. Built-in functions, variables can be excluded, etc.

+1
source

I recently did winupdate (20120508), and Visual Studio seems to really really be debugging subsequently with a 1 minute delay after compiling-to-runDebug-lag, then when the debugging program exited, another 1 minute delay before getting control of the visual studio again . I cleaned everything, but not joy.

Solution: I manually deleted the * .sdf and * .suo files in my project / solution and rebuilt. The problem went away magically.

I don’t know why, but something did not synchronize, was damaged or incompatible with the update, and it had to be blown off manually.

0
source

Source: https://habr.com/ru/post/915006/


All Articles