LKBEN10792: Howto debug a win32 application in release mode


This article has not been checked!

LKB | Created: 02/04/2020 | Version: 0 | Language: EN | Rating: 0 | Outdated: False | Marked for deletion: False

Author: Wim Peeters - Keskon GmbH & Co. KG


Symptom

You have differences between debug and release mode and need to find out why

Cause

none

Solution

Differences between debug and release mode do not happen every day. Most of the time these differences result from initialisation of variables.

To be able to debug in release mode, you are reading it right, you need to change your settings in visual studio a bit.

Steps to Debug an Application in Release Mode:
- Select from the Visual Studio Menu, Project->Settings
- In the "C/C++" Tab, select from the "Debug Info" drop down list "Program Database".
- Set the “Optimizations” to "Disable".
- In the "Link" Tab, select the "Generate Debug Info" option.
- Now Apply the new settings and rebuild all the files in your project.

you can now start to debug in release mode. You might see assembly code and your sourcecode in one screen. (Especially if you are debugging DLL's)

Please note to reset your settings and rebuild your project once you have fixed the bugs.

About the Author

Wim Peeters is electronics engineer with an additional master in IT and over 30 years of experience including time spent in support, development, consulting, training and database administration. Wim has worked with SQL Server since version 6.5. He has developed in C/C++, Java and C# on Windows and Linux in different European countries and different European languages. He writes knowledge base articles to solve IT problems and publishes them on the Lubby Knowledge Platform where he is one of the most important contributors and the main developer.

Disclaimer:

The information provided in this document is intended for your information only. Lubby makes no claims to the validity of this information. Use of this information is at own risk!