The Delphi Bug List

Entry No.
266
Debugger
Delphi's debugger does not recognise lines which end with LF, instead of CR-LF
1.02 2.01 3.0 3.01 3.02 4.0 4.01 4.02 4.03 5.0 5.01 6.0 6.01 6.02 Kylix 1.0
AbsentExistsExistsExistsExistsExistsExistsExistsExistsExistsExistsExistsUnknownFixedUnknown
Description
Reported by Hans-Josef Salm; checked by Chris Rankin, Jordan Russell
The situation: I had a source file that had originated on a MAC under Think Pascal. As I now know, it had some lines only ending with $0A [LF] rather than the normal sequence $0D $0A [CR-LF].
Result: Syntax checker, debugger messed up their line count. In addition, the edit/search-function when searching only the source code of one file would give a weird error and occasionally blow the system.

Note from checker:
I was able to reproduce the error with the debugger, but not the error with the edit/search function. Interestingly enough, Delphi has no trouble saving, loading and compiling with LF-terminated lines. However I was unable to persuade the editor to replace the LFs with CR-LFs.

Jordan Russell:
The debugger problem appears to still exist in Delphi versions up to and including 5.01. I can successfully compile a unit with LFs, but Step Over (F8) and Run to Cursor (F4) don't work. Interestingly, I found that Delphi 1's debugger works with LFs.

User-contributed comments
Thomas G. Grubb
21 Aug 2001  05:48 PM GMT
Loading the .pas file into Word, changing the file (add or delete a space), and saving fixes the problem. Word cleans up the file and seams to add the correct CR/LFs.

A related error, where the compiler and debugger can get confused (and go to the wrong line) by #IFDEF macros, is NOT fixed with this problem
anonymous
23 Apr 2002  11:41 AM GMT
Mac line endings are $0D. This is not supported.

The debugger and compiler are both happy with

Windows line endings: $0D $0A
Linux line endings: $0A
Latest update of this entry: 2002-05-01

Post a comment on this bug


Index page
Delphi Bug List home page
The Delphi Bug Lists are presently maintained by Jordan Russell, who has taken over this task from Reinier Sterkenburg since August 2000.
All feedback is appreciated. See also the feedback section of the Delphi Bug List home page.