Debugging in Delphi - how to move current line of Execution back.

Posted on 2009-04-26
Last Modified: 2013-12-12
Hi there,
I would like to know how to shift the current line of execution back to the previous line.
Sort of rewinding the debugging.
In Visual Studio it is possible by just dragging the arrow next tot he current line of execution back up the code. But i don't know how to do this in Delphi 6.
Question by:myleseven
    LVL 19

    Expert Comment

    This is not possible. I know you can do this in VB since it's not actually compiled, if it's possible in modern VS languages (.net) it's probably because it's managed code.

    Anyways, not possible in Delphi.
    LVL 7

    Accepted Solution

    IT IS POSSIBLE.  (at least since Delphi 7).

    All Delphi Versions:
    You open your CPU Window, and scroll back to the current line, and set the "Instruction Pointer" (EIP) to that line. Right-click in the dis-assembly pane, and select the item is near the bottom of the menu called "Set New IP" (or something similar depending on your version).

    Delphi 2007 and after:
    Right-click on the source, select Debug -> Set Next statement.  (simplifies the process w/o going through the CPU window)

    But, keep in mind, you variable state will not revert back to original values. You're simply adjusting the execution point.
    LVL 19

    Expert Comment

    That's cool to know, I'll try it out once. It's always a good day if you learn something new!

    Author Comment

    Thanks Ahalya that is exactly what I wanted.

    Author Comment

    BTW I am running Delphi 6 and it works.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Storage devices are generally used to save the data or sometime transfer the data from one computer system to another system. However, sometimes user accidentally erased their important data from the Storage devices. Users have to know how data reco…
    Skype is a P2P (Peer to Peer) instant messaging and VOIP (Voice over IP) service – as well as a whole lot more.
    This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
    THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.

    728 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

    19 Experts available now in Live!

    Get 1:1 Help Now