Delphi XE - All blue dots are shifted with one line up
Asked Answered
S

3

2

Since yesterday, all blue dots (compiled lines) in my source code are shifted with one line up. So, the first dot starts at 'var' instead of 'begin' and the last dot is one line before the last 'end' of a function.

I deleted all files (starting with DCUs) except DPR, PAS, DFM and DPRJ and recompiled. But the dots are still shifted. How can I fix this? It makes the step=by-step debugging almost impossible.

Simaroubaceous answered 7/7, 2011 at 11:31 Comment(10)
Clearing DCUs and forcing a full build is the usual way to fix this. Is it possible that your editor is looking at a different version of the source code file in a different file location from the version used in the project.Eanes
David is on to something! You can easily test this by entering some uncompilable gibberish somewhere within the file, and see if the compiler's complaining. If it's not, you're looking at one file and it is compiling an other.Siliceous
I just deleted the DCU in every single library I have and rebuild everything from zero. The dots are still shifted. This is indeed strange!Simaroubaceous
@Cosmin - I followed your advice and put random text right on the line where is the first dot (the line contained only the 'var' word) and the compiler immediately complained. There is another way to see the full path of the file that I am currently editing?Simaroubaceous
Is that unit part of a package? Are you using runtime packages? Did you do a search-for-files to look for all YourUnit.DCU files?Siliceous
@cosmin - yes. it is part of a package (that I just cleaned and rebuild - just to be sure). I will do a search now.Simaroubaceous
Just great. I deleted the DCU associated (this time, not all DCUs in the folder but only that specific DCU) with that file and the whole 'history' folder and recompiled. Now the dots are shifted with two lines (up) !!!!!!!!!!!!!!!!!!!Simaroubaceous
It could be that the file is corrupted so that you don't have proper line end combination (#13#10) on one line. Is the "one line up error" throughout the file or does it start somewhere in the middle of the unit?Lagrange
Try debugging without packages, to make sure you're using a "fresh" copy of the unit. Once debugging is done, recompile the package. And do a search & delete for the BPL and DCP's of the package as well, to make sure you're linking an up-to-date copy.Siliceous
@Lagrange - YES! It is starting at a certain point in my file. All blue dots are ok ABOVE that certain spot! Looks like a half-enter problem! I will hex edit the file.Simaroubaceous
L
7

It could be that the file is corrupted so that you don't have proper line end combination (#13#10) on one line. Is the "one line up error" throughout the file or does it start somewhere in the middle of the unit?

Beginning with Delphi 2007 (maybe already Delphi 2005) you can check the line ends in your code by enableing checkbox Show line breaks in Tools - Options - Editor options - Source options. The line breaks look like this:

enter image description here

As you can see, a CR on its own is not considered a line break and messes up the synchronization of the executable line dots

Lagrange answered 7/7, 2011 at 12:24 Comment(5)
fixed! Thanks a lot. Another mystery solved. Cosmin thank you also for your suggestions!Simaroubaceous
ain, I added some more info on the topicEnidenigma
OK. The OP has tagged the question with delphi-xe, I quess the option to show line breaks is already available there. It isn't in ie Delphi 7.Lagrange
I just checked D2007 and it is present. So it was added either in D2005 or D2007. It exists in all later releases, at least up till today.Enidenigma
Notepad++ could enter such "half-enters"Simaroubaceous
L
0

Try closing Delphi then deleting all *.identcache files.

I have a batch file at the root of my Delphi projects directory that recursively deletes all identcache files.

Latter answered 24/3, 2017 at 9:55 Comment(3)
I don't think they are related to the problem. "Temporary Cache File created by refactoring engine to improve performance. " delphi.wikia.com/wiki/Delphi_File_ExtensionsSimaroubaceous
@Turbine Sorry, I have no idea how this affects Delphi's debugger, only that it does. While using Delphi Berlin for the last couple weeks, the debugger will occasionally go out of sync with the project. The program ignores all breakpoints and the blue dots are not in the correct place. Deleting the identcache files has fixed the problem each time.Latter
@Turbine This is an old question, but a recent question #42991892 was closed as a duplicate to this one.Latter
J
0

Try This:

  1. Open the unit in an editor with capabilities to change codification, like Notepad++.

  2. Code/save the file as ANSI.

  3. Open or recharge the file in the Delphi IDE.

The dots must be in the right place.

Jassy answered 7/2, 2020 at 12:51 Comment(1)
This answer is incorrect. It has nothing to do with collation. The problem has to do with improper line endings (a CR alone instead of a CRLF combination). That information is provided in the previous answers, all of which were written nearly 4 years ago. (The Delphi IDE has supported non-ANSI content since long before the XE version, BTW.)Phenology

© 2022 - 2024 — McMap. All rights reserved.