Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 509
  • Last Modified:

delphi 2009 debug problem

I have a strange problem with a Delphi 2009 application
I run it in the IDE in debug mode with a breakpoint somewhere
The debugger does not break at that line in the unit, says line number N but well at line number N + 2 !
What I mean is that the highlighted line by the debugger is line N, but tjhe execution  is already 2 lines ahead.
So when I continue step by step, it continues always with these 2 lines ahead
Impossible to ... not become crazy !
1 Solution
Ferruccio AccalaiSenior developer, analyst and customer assistance Commented:
You should have the Option Optimization (in Project Options : Compiler : Code generation : Optimization) set to True, so the Ide use optimized code that is better than yours and is skipped.
Uncheck that option and use it just only before the last compile, when your code is reaaly bug free.

Re-build all

It may be related to a question I have answered in the past here:
Geert GruwezOracle dbaCommented:
this usually happens when you have opened a directory in your delphi IDE with a different .pas (but with the same name)
Delphi first checks the current directory when looking for .pas files.
LeTayAuthor Commented:
Many thanks !
I just used copy/paste for all the unit to a new file and renamed the file
I saw that the resulting filet was just one byte shorter !
And now the debug is okay

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now