Move the Program Counter in Delphi Debugging
Asked Answered
S

3

6

In Visual Studio, when you're debugging with breakpoints you can change which line of code will be next to execute by dragging the execution cursor to another line; this lets you skip IF statements and the like.

I was idly wondering if there was a similar feature in Delphi anyone knew about?

I've been having a look around in the CPU window (Delphi 2006) but you only seem to be able to run through the instructions in order, not skip them.

Shakta answered 2/12, 2010 at 10:6 Comment(2)
+1 for mentioning PC instead of IP :)Aristotelianism
Haha, thanks. I was trying to remember the right term, it's been ages since I studied compsci xDShakta
C
7

In CPU View you can right-click and choose "New EIP (Ctrl + N)" to set the instruction pointer.

Calvados answered 2/12, 2010 at 10:14 Comment(1)
Sweet, that's exactly what I wanted. Ta! :)Shakta
D
8

In Delphi XE you can drag the execution cursor to another line as well. Not in the CPU window, but in the editor itself.

Deprecatory answered 2/12, 2010 at 10:34 Comment(3)
Just tried and this works in Delphi 2010 as well. I did not know that, thanks.Calvados
You can also right-click > Debug > Set Next Statement to do the same thing. That one has been around for ages too.Characteristic
@DavidM That's also really useful, thanks! I didn't think of looking there; the editor right-click menu has so menu options that my eyes glaze over when I look at it.Shakta
C
7

In CPU View you can right-click and choose "New EIP (Ctrl + N)" to set the instruction pointer.

Calvados answered 2/12, 2010 at 10:14 Comment(1)
Sweet, that's exactly what I wanted. Ta! :)Shakta
I
1

In the IDE of 2007 you can also set the execution pointer from the Debug-Contextmenu in the sourcecode. I've tried it a few times, but its very tricky. Don't try to move the pointer outside any begin-end block or it will bite you in the @ss later

Ium answered 2/12, 2010 at 11:27 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.