none
none

Reputation: 4827

no correlation of the debugger line marked , and the effect on variables

this is odd, as debugging code, it seems that the Delphi is not pointing to the right line of code, after break point.

is there a way to fix this?

Upvotes: 0

Views: 130

Answers (2)

Cosmin Prund
Cosmin Prund

Reputation: 25678

You need to make sure the source file you're looking at corresponds to the code that's actually being executed. Check the following:

  • You are not using runtime packages. If you do use runtime packages, make sure the runtime package is compiled using your latest version of the PAS file.
  • You are actually compiling the PAS file. Add the file to your project to be sure. This can hit you, for example, when modifying a file from the VCL: You're modifying the PAS file but you're linking the pre-compiled DCU provided with Delphi. I usually check this by entering junk in the PAS file (those forcing a compile error), rebuilding the app and looking for the error. If the compiler doesn't complain about my junk then I know for sure I'm not compiling the PAS file I'm looking at.

There was a question here recently that unveiled an other way of hitting that error: If some of the lines in your PAS file have abnormal line terminators, you might see a constant offset between the executed line of code and the actual line of code in the program.

Upvotes: 6

David Heffernan
David Heffernan

Reputation: 612934

This happens when the .pas file that the editor has loaded is not the one used to generate the .dcu used by the debugger.

Delete all your .dcu files and rebuild.

Upvotes: 4

Related Questions