[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: GDB behaviour of step/next
From: |
Kevin Buettner |
Subject: |
Re: GDB behaviour of step/next |
Date: |
Fri, 20 Apr 2001 02:58:08 -0700 |
On Apr 20, 4:30pm, Hiroichi MAKIDA wrote:
> In "main.c" I expand a 'for-loop' in "org.c" and use '#line' to
> associate lines in "main.c" with "org.c"'s.
>
> "main.c" is compiled with the following command(GCC version is
> 2.95.3).
> gcc -g main.c
>
> -- "main.c" --
> #line 6 "org.c"
> sum = 0;
> #line 7
> i = 0;
> #line 7
> loop_top:
> #line 7
> if (i > 10) {
> #line 7
> goto next:
> #line 7
> }
> #line 8
> sum += i;
> #line 8
> i++;
> #line 8
> goto loop_top;
> next:
> -----------------
>
> -- "org.c" --
> 6: sum = 0;
> 7: for(i=0;i<=10;i++ {
> 8: sum += i;
> 9: }
> -------------
>
> When execute position is line 8(sum += i;) and I execute either 'step'
> or 'next', GDB doesn't stop on line 7(for(i=0;i<10;i++)) but on line
> 8(sum += i;).
>
> Is this right behaviour?
Yes. If you wish to step by individual lines in main.c, you will
need to eliminate the #line directives.
Kevin