This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch, Fortran] PR 34153 - Allow setting a breakpoint in the END PROGRAM/SUBROUTE line


Tobias Burnus wrote:
Hello all,

debugging of code such as

   subroutine foo(x)
      external
      integer, intent(out) :: x
      x =  f()
      ! some comment
   end subroutine foo

had the problem that you could not set a break pointer after "x = f(x)".
And then a "step" would return into the calling procedure - thus one
could not "print x" after the assignment.

The problem became clear for the short program
    subroutine foo()
    end subroutine foo
using "readelf --debug-dump=decodedline". The result was:
  File name                            Line number    Starting address
  test.f90                                         1                   0
  test.f90                                         1                 0x4

while "ifort" had the line numbers "1" and "2". The problem is that the
input_line remained at "subroutine foo()" instead of jumping to "end
subroutine foo()". The simplest solution for me was too add the new
EXEC_END_PROCEDURE which is a NOOP but sets in trans.c the line number.

Bootstrapped and being regtested on x86-64-linux. OK for the trunk?

Ok if no failures, as discussed on IRC.


Daniel

--
Done:  Arc-Bar-Cav-Ran-Rog-Sam-Tou-Val-Wiz
To go: Hea-Kni-Mon-Pri


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]