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

             Bug #: 54503
           Summary: debug: Consider using the beginning of the main
                    program as locus for the set_* calls
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: fortran
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: bur...@gcc.gnu.org


Follow up to PR 54405

For the program

  program essai_1
     x = 1.0
  end program

gfortran generates the following dump:

/************************************************/
[hjff.f90 : 3] {
  real(kind=4) x;

  [hjff.f90 : 2] x = 1.0e+0;
}


main (integer(kind=4) argc, character(kind=1) * * argv)
[hjff.f90 : 3] {
  static integer(kind=4) options.0[7] = {68, 1023, 0, 0, 1, 1, 0};

  [hjff.f90 : 3] _gfortran_set_args (argc, argv);
  [hjff.f90 : 3] _gfortran_set_options (7, [hjff.f90 : 3] &options.0[0]);
  [hjff.f90 : 3] essai_1 ();
  [hjff.f90 : 3] return 0;
}
/************************************************/

Thus, if one sets a break point in "main", the position is 'end program'. If
one now steps ("s") through the program, one remains in that line for the
set_args/set_options calls, then one jumps to "MAIN__" alias "essai_1" in line
2 for the assignment - and for the rest, one remains as expected in line 3.

I wonder whether it wouldn't be more natural to have "main" and the set_*
functions with the locus of line 1 - and keep the "return 0" with the locus
line 3.

It's of low priority as doing a "n" won't do what users will expect either: It
jumps over the "essai_1()" call to the "return 0". Thus, it is only a minor
glitch.

Reply via email to