Thank you for your reply.

On Fri, 20 Apr 2001 02:58:08 -0700
Kevin Buettner <[EMAIL PROTECTED]> wrote:

> Yes.  If you wish to step by individual lines in main.c, you will
> need to eliminate the #line directives.

I think that "main.c" is compiled for execution and "org.c" is shown
to user for debug.

If I eliminate the #line directives, the executed statement in "main.c"
and the execute position shown by GDB will differ. So I want to keep the
#line directives.

I think the problem is that GDB doesn't stop at 'if (i > 10) {'
after step(or next) execution of line 8('goto loop_top;').
I think that the line number changes from 8('goto loop_top;') to
7('if (i > 10) {'), so GDB will stop at 'if (i > 10) {'.

Is this behaviour a spec.?

-- "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:    }
-------------

--------------------------------------------------
Hiroichi MAKIDA
[EMAIL PROTECTED]

_______________________________________________
Bug-gdb mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-gdb

Reply via email to