. - release_mode_breakpoint() . :
#pragma optimize("", off)
void release_mode_breakpoint()
{
int put_breakpoint_here = 1;
}
#pragma optimize("", on)
You can then put a breakpoint on this int declaration line, and it will be deleted even in release mode. Then simply raise the stack in the debugger back to the function in which you really wanted to get a breakpoint.
In fact, do not leave this code in your final release, since an unoptimized line may prevent the compiler from optimizing the call code correctly.
source
share