delphi 2009 debug problem

Posted on 2009-12-28
Last Modified: 2012-05-08
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 !
Question by:LeTay
    LVL 22

    Expert Comment

    by:Ferruccio Accalai
    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.
    LVL 13

    Expert Comment


    Re-build all

    LVL 14

    Accepted Solution

    It may be related to a question I have answered in the past here:
    LVL 36

    Expert Comment

    by:Geert Gruwez
    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.

    Author Closing Comment

    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

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Join & Write a Comment

    Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
    Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now