https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115111

            Bug ID: 115111
           Summary: Incorrect line debugging locations at start of WHILE
                    loop.
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: modula2
          Assignee: gaius at gcc dot gnu.org
          Reporter: gaius at gcc dot gnu.org
  Target Milestone: ---

The line debugging locations appear wrong at the start of a WHILE loop.
This can be seen when single stepping the following program using the
-fm2-whole-program -g options:

$ gm2 -fm2-whole-program -g -fiso testrestline.mod
$ cat testresline.mod
 MODULE testrestline ;

IMPORT SeqFile, TextIO ;

VAR
   chan    : SeqFile.ChanId ;
   line    : ARRAY [0..5] OF CHAR ;
   results : SeqFile.OpenResults ;
BEGIN
   SeqFile.OpenWrite (chan, "test.input", SeqFile.write, results) ;
   TextIO.WriteString (chan, "a line of text exceeding 6 chars") ;
   TextIO.WriteLn (chan) ;
   TextIO.WriteString (chan, "a second lineline of text exceeding 6 chars") ;
   TextIO.WriteLn (chan) ;
   SeqFile.Close (chan) ;

   (* Now see if we can read the first line.  *)
   SeqFile.OpenRead (chan, "test.input", SeqFile.read, results) ;
   TextIO.ReadRestLine (chan, line)
END testrestline.

The while loop behavior can be seen in TextIO.ReadRestLine.

Reply via email to