Delphi: why breakpoints from time to time are not usable (green highlighted line on IDE)?

LaBracca picture LaBracca · Apr 15, 2011 · Viewed 40k times · Source

From time to time I lose breakpoint functionality in Delphi.

I thought this to be a Delphi 2009 issue but now I have also it in Delphi XE.

In Delphi 2009 by deleting .dproj file I made the breakpoints work again.

In Delphi XE I am not able to make breakopints appear. I have update 1 with all hotfixes applied.

Does anyone have a solution?

Answer

Ken White picture Ken White · Apr 15, 2011

Debug info isn't present in the file.

Make sure that you're using the Debug configuration. (Project Manager tree, expand Build Configurations, make sure Debug is bold. If it's not, right click Debug and choose Activate from the context menu.) Make sure you then do a Build of your project, not just a Compile.

If that still doesn't work, go to Project->Options from the IDE's main menu, click on Compiling under Delphi Compiler, and check the Debugging section on the right half of the window. Make sure that Debug Information and Local Symbols are both checked. If you're trying to trace into the VCL's own source, also check Use debug .dcus (you'll want to turn this off and do a full build of your project as soon as you're done, as it gets annoying when you're debugging normally). Again, you'll want to build and not compile.

If all of the above fails, another possibility is that the code unit you have open in the Code Editor isn't the same one being seen by the compiler. Make sure you don't have multiple copies of the file on your computer in a location that the compiler might find first. If you're not sure, delete the .dcu files with that unit name and then do a build of your project, and see if the newly created .dcu is in the location you'd expect.