#include <iostream>
using namespace std;
int main()
{
int x = 0;
while(true)
{
if(x % 10)
{
cout << "Hello world!" << endl;
}
++x;
}
return 0;
}
* put breakpoint on line 16 [return 0;]
* start debugger
==> it stops twice at line 17 [}]
Active debugger config: GDB debugger:Default
Building to ensure sources are up-to-date
Selecting target:
Debug
Adding source dir: C:\Projects\BreakPointTest\
Adding source dir: C:\Projects\BreakPointTest\
Adding file: C:\Projects\BreakPointTest\bin\Debug\BreakPointTest.exe
Changing directory to: C:/Projects/BreakPointTest/.
Starting debugger: C:\MinGW32\bin\gdb.exe -nx -fullname -quiet -args C:/Projects/BreakPointTest/bin/Debug/BreakPointTest.exe
done
Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints
Debugger name and version: GNU gdb (GDB) 7.2
Child process PID: 3452
At C:\Projects\BreakPointTest\main.cpp:17
Continuing...
At C:\Projects\BreakPointTest\main.cpp:17
Continuing...
This only happens when there's a breakpoint at that line 16 (I guess, the line before the end). When you remove the breakpoint at line 16, and put it somewhere else, all is fine.