Why does gdb stop at a different line than “i b” shows while returning from function?

view full story

http://www.unix.com – Here is the program I am trying to debug: Code: #include <stdio.h> int i = 5; int main(void) {     int x = 3;     display(x);     return 0; } void display(int x) { for ( i=0; i<x; ++i ) {     printf("i is %d.\n", i); } } This code is coming from here Peter's gdb Tutorial: Stepping And Resuming. Here is the problem: Code: (gdb) break display Breakpoint 1 at 0x40051e: file try5.c, line 15. (gdb) run Starting program: /home/ja/gdb/learning/try5 Breakpoint 1, display (x=3) at try5.c:15 (gdb) frame 1 #1  0x000000000 (HowTos)