I feel hard to write an brief example to explain the matter of
breakpoint.
"The debugger associates breakpoints with a selected line number in the
source code. But in release build code the relationship between source
code lines and the optimized machine code can get pretty vague: There
may be no specific place in the machine code that corresponds to the
source line. "
Can anyone help me?
A simple example:
<code>
#include <tchar.h>
void DoSomeUselessStuff(int i)
{
int a = 0;
for (int k=0; k<i; k++)
a += i;
}
int _tmain()
{
DoSomeUselessStuff(12);
}
</code>
In debug-builds, you can set a breakpoint into the function
"DoSomeUselessStuff".
In release builds (/O2) you can´t... (the function will not be there)
Re: Debug vs. Release code. ... >> build is run in VS.NET, assuming symbols have been generated, it can ... > It will not stop on your breakpoint.... Symbols are used to 'link' source code to the run time code. ... still attach a debugger to a process even if it is in release mode. ... (microsoft.public.dotnet.framework.clr)
Re: In writting debugger, how can the program be stopped when breakpoint is encountered? ... > In writting debugger, how can the program be stopped when breakpoint ...Breakpoint at a specific source line ... 1.the debugger figures out where does the machine code corresponding to line 12 start, by looking in the debug infos compiled with your program ... 2.the debugger replaces the machine code instruction at that address with a specific instruction that branches to the debugger ... (comp.os.linux.misc)
Re: Debug vs. Release code. ... although it is possible to attach a debugger... >> It will not stop on your breakpoint.... > Symbols are used to 'link' source code to the run time code. ... (microsoft.public.dotnet.framework.clr)
Windows 7, VS 2005 and breakpoints ... I have created a brand new WinForm project with one ... message is "The breakpoint will not currently be hit. ... The source code is ... I have VS 2005 loaded with SP1 and SP1 fix for Vista ... (microsoft.public.vsnet.debugging)