http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54405

             Bug #: 54405
           Summary: bad debugging info which lead to a wrong behavior of
                    reverse-next in gdb
    Classification: Unclassified
           Product: gcc
           Version: 4.6.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: edouard.ca...@irisa.fr


Created attachment 28098
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28098
short fortran source file used in the example

Reverse debugging works badly with the attached fortran source file, at least
when using GCC 4.6.3 and GCC 4.7.1.

More precisely, during debugging, the first use of the 'reverse-next' command
(after using record, of course), makes the debugger jump back the first line
where the 'record' command was applied; for example:

===================

(gdb) break MAIN__
Breakpoint 1 at 0x402f87: file essai_1.f90, line 3.
(gdb) run
Starting program: .../essai_1 

Breakpoint 1, essai_1 () at essai_1.f90:3
3       x = 1.0
(gdb) record
(gdb) n
4       print *, "x = ", x
(gdb) n
 x =    1.00000000    
6       x = 2.5
(gdb) n
7       print *, "x = ", x
(gdb) n
 x =    2.50000000    
9       x = 3.14159265
(gdb) n
10       print *, "x = ", x
(gdb) n
 x =    3.14159274    
12    end program
(gdb) reverse-next
4       print *, "x = ", x

==================

The behavior is correct with GCC 4.5.4, so I think it is a regression problem.

The problem has been detected with gdb-7.4 and gdb-7.5.

Reply via email to