I am using (C++) Visual Studio 2010.
I have to trace the control flow of my Application. To do so, I have put a break point in the source code.
While running
Release mode breakpoints are handy to get working. The simplest way to get it working is to make a call to a function called release_mode_breakpoint()
in your code. Then define that function like this:
#pragma optimize("", off)
void release_mode_breakpoint()
{
int put_breakpoint_here = 1;
}
#pragma optimize("", on)
You can then put a breakpoint on that int declaration line, and it'll be hit, even in release mode. Then just step up the stack in the debugger back to the function you actually wanted a breakpoint in.
Don't actually leave that code in your final production release though, as the unoptimized line may prevent the compiler from optimizing the calling code properly.