Some tips for Delphi debugger - part 2

by Radek Červinka 29. January 2011 00:28

In last part of debugger's tips I showed some nice Delphi debugger tricks, so let's continue.

Change executing line

Delphi 2010+ (maybe 2009?). Nice example code.

    1program Project1;
    2
    3{$APPTYPE CONSOLE}
    4
    5procedure TestB;
    6begin
    7  writeln('b1');
    8end;
    9
   10procedure TestA;
   11begin
   12  writeln('a1');
   13  TestB;
   14end;
   15
   16begin
   17  writeln('a');
   18  TestA;
   19  writeln('b');
   20  writeln('c');
   21end.

Starting with this version, you can change current line simple only with mouse. Drag current line cursor and drop on another source code line.

When problems with video - please use direct link.

Another tip: in CPU view is possible change current line via EIP register. Click on line and from popup menu select New EIP (this menu item has own hot key - CTRL+N).

Call stack breakpoint

Nice debugger extension from Delphi 2007. Consider the example mentioned earlier, when we are in TestB and we want set breakpoint for line after return from inner procedure (for example in recursion). In this case call stack breakpoint is very handy.

In call stack window breakpoint can be set when click on blue dot or via popup menu - see image.

Delphi CallStack Breakpoint

(screenshot is from Delphi XE)

Tags: , , , , ,

Practices

Comments

9/30/2010 4:00:03 PM #

Radim

Změna řádku vykonávání - toto je skutocne super. Ani som netusil ze sa niecoho takeho dozijem.

Vdaka. Radim

Radim |

10/5/2010 3:50:54 PM #

mayer

Zmena vykonavaneho radku pri debugovani - alespon neco.
Pred mnoha lety ve Visual C++ 6.0 v ramci debugovani pribyla novinka v podobe zmeny vykonavaneho radku, rekompilace drobne zmeny + patch na ladenou aplikaci. Byla to neuveritelne chytlava vec, nalezla se chybka, provedla se oprava a ihned se mohlo pokracovat - kdyz to pochopitelne slo. Nutnost znovu startovat aplikaci a opetovne se propracovat k ladenemu mistu me v Delphi hodne vadila.

mayer |

10/5/2010 4:20:14 PM #

radekc

Ve Visual C++ je rekompilace s patchem v podstatě nutnost vzhledem k délce kompilace. Tím neříkám, že bych to neocenil i v Delphi. Každopádně je to krok kupředu.

radekc |

Comments are closed