views:

277

answers:

3

I'm a .NET developer, but I have got quest - must find errors in Delphi project.

After opening a project (Borland Delphi 7) and trying to debug it ('Run' menu), I've noticed all debugging options are inactive (gray).

How can I make it usable?

A: 

The debugger is always active, unless it is explicitly deactivated. Just run the application and the inactive menu items will become active. (For some options you have to have to pause the running application)

Just try pressing F8. This will run the application and pause at the first line of executable code and most of the debugging items will become active.

DR
Thanks for reply. After pressing 'Run' -> 'Run' application is running and debug options are inactive. It's not possible to pause application. Pressing F8 has no effect.
newbieDelphi
A: 

Hard to tell just from that description, but here are a few pointers.

  • Make sure you've got a project (.dpr) loaded, and not just a source (.pas) file.
  • Try to build the project with SHIFT-F9. When it's done, if everything compiles successfully, you'll see blue dots in the "gutter" at the left side of the text editor, showing which lines actually contain debuggable code. If you don't get any of those, go into Project Options and turn on the Debug option, then rebuild.

Once you've done that you should be able to run and debug the app.

Mason Wheeler
It's compiling and building. I can see blue dots and toggle breakpoints. But debugging is still unavailable.
newbieDelphi
+7  A: 

I'm not sure why the pause button doesn't work, but I have seen Delphi 7 get "confused" and refuse to stop on legitimate breakpoints before.

  • Make a backup of everything, just in case you don't have the source for all of the DCUs.
  • Delete the project's DCUs.
  • Make sure you're including debug information in the project's options.
  • Do a full build (not just a recompile).

I hope this helps.

Bruce McGee
Thanks, it's working now.
newbieDelphi