1

I have Delphi 2006. Suddenly it has started behaving erratically. If I run to a breakpoint, it stops, but the next time I start it, the program runs but ignores breakpoints. If I reset the debugger and run the program from start again, the breakpoint works again, but only once.

If I attempt any function like setting a variable watch after it has stopped at a breakpoint, the IDE hangs. Task manager shows no memory or I/O activity on BSD.EXE but the CPU is stuck firmly at 50% (presumably one of my 2 cores in a tight loop).

So I can reproduce the problem by:

  • starting Delphi
  • loading my project
  • full build
  • set breakpoint on first line
  • run (program breaks on first line)
  • select a variable name in the source and drag it onto the watch window
  • BOOM!

This behaviour is confined to one particular program being debugged, and happens after a PC/IDE restart.

The app is several 100,000 lines.

Something must be damaged, but where do I start? It points to something my program is doing damaging the IDE, but I can reproduce the problem by breaking on the first line of the DPR file!

Could it be that the compiler is choking on some piece of code I have recently added?

I guess the next step is to start walking backwards, removing the stuff I have added until the problem goes away, but I'm hoping someone can shed some light first.

Vertexwahn
  • 7,709
  • 6
  • 64
  • 90
rossmcm
  • 5,493
  • 10
  • 55
  • 118
  • 3
    delphi-2006 is late dark ages of Delphi. Upgrade, Delphi XE (which I currently use) is rock solid compared with delphi-2006. – kludg May 04 '12 at 02:48
  • @Serg I do have XE, just haven't had the time to migrate – rossmcm May 04 '12 at 03:11
  • 1
    Upgrade to your copy of XE :-) I started on Delphi 2006 and hated the constant problems like this. 10+ restarts per day etc. Then upgraded to 2010 and it is actually OK to use. – awmross May 04 '12 at 04:33
  • 1
    Delphi-2007 is much more stable and dcu compatible with Delphi-2006. This means that it's easy to move to this platform from Delphi-2006. If you have XE, chance is that you have the permission to use Delphi-2007 as well. Depends on how you upgraded. – LU RD May 04 '12 at 06:07
  • I experience this exact same issue with XE2 from time to time. The simple solution is to do a re-build of your project. At least this works for me. I haven't used 2006, but have used 2010, and the problem was there too. – Jerry Dodge May 04 '12 at 16:12
  • @Jerry, rebuilding doesn't seem to help. The same source set compiled and run my home machine doesn't show any such problems. – rossmcm May 05 '12 at 04:14

2 Answers2

1

Delphi is too much complex when it comes to configuration options. I used the same windows instalation for five years and my Delphi 2006 was very buggy at the end. And I had many 3rd party packages and some of my own.

The solution was to:

  1. Create two folders (1 to bpl files, other to packages) ;
  2. Create a subfolder for each component pack ;
  3. Use small names for not overload the lib path ;
  4. Take note of every pack to instal in a text file ;
  5. Refresh Tools\Library Path with the new paths of the packs source, drc etc. ;
  6. Remove the old delphi instalation ;
  7. Make a new, clean and documented install of everything.

When a package shows any error, remove it from the Components\Install Packages and then remove it's subfolder of files.

NaN
  • 8,596
  • 20
  • 79
  • 153
0

I've had issues debugging with Delphi (both 2006 and 2010 exhibit a similar behavior) when building using runtime packages.

If everything is included in the exe, it's rock solid. Otherwise, the behavior is pretty similar to what you describe.

I can't say if it's because of badly built home made package or something specific with Delphi.

Ken Bourassa
  • 6,363
  • 1
  • 19
  • 28