[vox-tech] gdb: until doesn't work as advertised?
Peter Jay Salzman
vox-tech@lists.lugod.org
Fri, 20 Sep 2002 12:28:19 -0700
begin msimons@moria.simons-clan.com <msimons@moria.simons-clan.com>
> On Thu, Sep 19, 2002 at 05:02:35PM -0700, Peter Jay Salzman wrote:
> > begin msimons@moria.simons-clan.com <msimons@moria.simons-clan.com>
> > i agree the above is clearly written. the real problem, i guess, is
> > that i should've given you a sample of what i'm talking about. :) so
> > here it is:
>
> This sample is good. The only difference I saw between this and the
> other emails are explict commands on each line (instead of just using
> return to repeat the previous command).
>
> > p@satan% gdb until_demo
> > (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) break 9
> > Breakpoint 1 at 0x8048420: file until_demo.c, line 9.
> [...]
> > so you see, until doesn't seem to step out of this loop. from looking
> > at this, it looks like until is behaving exactly like next.
>
> You set a breakpoint inside the loop. The description for "until"
> doesn't say that it will disable all breakpoints until a higher code
> address is reached. It will run the program until a higher line or (for
> good reason), another break condition is hit... (breakpoint, watchpoint,
> signal, whatever).
AIIIEEEEEEE!!!!!!!!
now i feel really stupid. ach.
thanks for pointing this out to me. i can't believe this didn't occur
to me last night.
pete