bug-gdb
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

GDB behaviour of step/next


From: Hiroichi MAKIDA
Subject: GDB behaviour of step/next
Date: Fri, 20 Apr 2001 16:30:58 +0900

I'm using GDB version 5.0 on RedHat Linux 6.2(for Intel PC) and facing
the following problem.

Please consider the following program.

I have written two C program("main.c" and "org.c"). "main.c" is
compiled for debug. "org.c" is displayed by GDB for source-level
debug.

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?

----------------------------------------------------------------------
Hiroichi MAKIDA
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]