User forums > General (but related to Code::Blocks)
breakpoint error on the debugger branch
(1/1)
killerbot:
--- Code: ---#include <iostream>
using namespace std;
int main()
{
int x = 0;
while(true)
{
if(x % 10)
{
cout << "Hello world!" << endl;
}
++x;
}
return 0;
}
--- End code ---
* put breakpoint on line 16 [return 0;]
* start debugger
==> it stops twice at line 17 [}]
--- Code: ---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...
--- End code ---
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.
oBFusCATed:
What is the raw/debug log looking like?
Also what happens in the trunk version or when you try gdb from command line?
p.s. You can look at the callstack to see if there are more functions above main.
Sometimes stepping out of the main function goes to other system/runtime functions, but there are no symbols for them and C::B tries to be smart by setting the active frame the one with valid symbols.
ollydbg:
@killerbot, I can confirm this bug.
The strange thing is the breakpoint was reached before the while loop, and the breakpoint meet twice.
I think it is a gcc error which give wrong symbol/line information. :D
Navigation
[0] Message Index
Go to full version