Jump to content
  • Advertisement
Sign in to follow this  
Jossos

why does visual studio do this?

This topic is 920 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

In release mode it won't update the file when i clean/rebuild

 

It hits the first breakpoint, but won't actually enter the function:

 

vsbs.jpg

 

EDIT:

 

Also this problem makes no sense:

 

vsbs2.png

 

it is empty yet it's clearing? i have that if statement specifically to stop it from doing that.

Edited by Jossos

Share this post


Link to post
Share on other sites
Advertisement
Release builds are not meant for debugging on any compiler. Debug information gets stripped and several optimizations make stepping through a program difficult or impossible (sequence might change, function calls do not even exist anymore, ...). Even if you can step through the program the values you see when inspecting the contents of variables are often unreliable.
CMake will by default generate a RelWithDbg configuration for you (basically settings normally used in Release builds but with debug information added back in) for example, but even that is not pleasant debug experience. Edited by BitMaster

Share this post


Link to post
Share on other sites

Release builds are not meant for debugging on any compiler. Debug information gets stripped and several optimizations make stepping through a program difficult or impossible (sequence might change, function calls do not even exist anymore, ...). Even if you can step through the program the values you see when inspecting the contents of variables are often unreliable.
CMake will by default generate a RelWithDbg configuration for you (basically settings normally used in Release builds but with debug information added back in) for example, but even that is not pleasant debug experience.

That isn't the issue. It won't recompile that cpp for some reason. it's using the old code.

Share this post


Link to post
Share on other sites


That isn't the issue. It won't recompile that cpp for some reason. it's using the old code.

What makes you think that? Debugging is impossible in Release build, so anything it tells you is false.

Share this post


Link to post
Share on other sites

 


That isn't the issue. It won't recompile that cpp for some reason. it's using the old code.

What makes you think that? Debugging is impossible in Release build, so anything it tells you is false.

 

I've changed the pulse.expand amount in the left window. Debug mode it is the correct size, in release it is acting as it was before. I'm not using debug-anything, I can literally see it with my eyes.

Edited by Jossos

Share this post


Link to post
Share on other sites

Okay... Have you tried full rebuild? Are you sure old .exe, .obj files, etc. aren't in use by another process (ex. your Release build is still running as process without window because of incorrect shutdown)? Sometimes Visual Studio silently fails when that is the case.

Edited by Zaoshi Kaba

Share this post


Link to post
Share on other sites

Check your VS settings to find the setting that decides what to do when a build fails when debugging. You may have accidentally set it to use the last successful build.

 

Try to clean and build and then look at the output for error information. I suspect that the previous build is hanged in the background with no window open. VS can't write to the exe in this case. You'll need to kill it from task manager.

 

edit - My bad, I missed Zaoshi's post somehow.

Edited by Khatharr

Share this post


Link to post
Share on other sites

If it doesn't recompile your file, check for compilcation/link errors.

Also do a clean (Or manual deletion) and recompile everything. (Project references also).

Share this post


Link to post
Share on other sites

 


Debugging is impossible in Release build, so anything it tells you is false.

 

 

"Debugging is harder in Release builds, so anything it tells you requires more careful analysis."

 

Fixed it for you. ;)

 

I do like 80% of my debugging on our game in Release builds. It's (sometimes) difficult, sure, but it's an absolutely essential skill to master. Especially as later when most of your bugs come QA passes on Release builds or even from automatic crash reports on the public released build of your game. smile.png

 

 

Do you have any tips to share?

 

When I come across Release build bugs, I often feel like my only recourse is to insert various logging statements to narrow down what's going on.

This obviously doesn't always help, and can even mask the bug entirely if it's a race condition and the logging statements affect timing, etc...

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!