Advertisement

why does visual studio do this?

Started by January 09, 2016 08:21 AM
11 comments, last by RobTheBloke 8 years, 11 months ago

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.

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.
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.

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


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.


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.

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.

Advertisement

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.

void hurrrrrrrr() {__asm sub [ebp+4],5;}

There are ten kinds of people in this world: those who understand binary and those who don't.

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).


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

Sean Middleditch – Game Systems Engineer – Join my team!


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...

Hello to all my stalkers.

This topic is closed to new replies.

Advertisement