I'm trying to debug a program I wrote in C++. Here is the code:
void a() { }
void b() { a(); }
int main() { b(); return 0; }
I compiled it using: g++ -g3 -O0 -o cards.exe cards.cpp
.
Here is the output of my gdb session:
(gdb) b main
Breakpoint 1 at 0x401421: file cards.cpp, line 10.
(gdb) r
Starting program: C:\workspace\Cards\src/cards.exe
[New thread 1624.0xa28]
Breakpoint 1, main () at cards.cpp:10
10 int main()
(gdb) n
12 b();
(gdb) n
b () at cards.cpp:5 5
void b()
(gdb) n
7 a();
(gdb) quit
The program is running. Exit anyway? (y or n)
My question is, why does sending a next command to gdb still step into a function? I'm using g++ 4.2.1-sjlj and gdb 6.8.