[vox-tech] gdb: until doesn't work as advertised?

Peter Jay Salzman vox-tech@lists.lugod.org
Thu, 19 Sep 2002 17:09:21 -0700


argh.   this could get confusing...  let me try again:


p@satan% gdb until_demo
gdb: Symbol `emacs_ctlx_keymap' has different size in shared object,
consider re-linking
(gdb) break 9
Breakpoint 1 at 0x8048420: file until_demo.c, line 9.
(gdb) l
1       #include <stdio.h>
2
3       int main(void)
4       {
5               int i=0, j=0;
6               scanf("%d", &i);
7
8               while (i) {
9                       i--;
10                      j++;
(gdb) commands
Type commands for when breakpoint 1 is hit, one per line.
End with a line saying just "end".
>printf "i is %d\n", i
>end
(gdb) run
Starting program: /home/p/writing/ddd/src/until_demo 
10

Breakpoint 1, main () at until_demo.c:9
9                       i--;
i is 10
(gdb) until
10                      j++;
(gdb) until
11              }
(gdb) until

Breakpoint 1, main () at until_demo.c:9
9                       i--;
i is 9
(gdb) until
10                      j++;
(gdb) until
11              }
(gdb) until

Breakpoint 1, main () at until_demo.c:9
9                       i--;
i is 8
(gdb) until
10                      j++;
(gdb) until
11              }
(gdb) until

Breakpoint 1, main () at until_demo.c:9
9                       i--;
i is 7
(gdb) until
10                      j++;
(gdb) until
11              }
(gdb) until

Breakpoint 1, main () at until_demo.c:9
9                       i--;
i is 6
(gdb) until
10                      j++;
(gdb) until
11              }
(gdb) until

Breakpoint 1, main () at until_demo.c:9
9                       i--;
i is 5