Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Debugging problem - Not accepting breakpoints

Status
Not open for further replies.

Aces4Bases

Programmer
Oct 28, 2007
2
IE
Hi Folks

I have a problem with a project that i have inherited from some former work colleagues. There are vast chunks of the code that will not accept breakpoints.

When i place a breakpoint into the code the line goes red as per usual. There are no 'Marked Lines' in the left hand margin to accept breakpoints and when i run the code the line goes greent to show that i cannot trace into the code at this point.

Can you guys please point me in the right direction on this.

Regards
Stephen
 
breakpoint turn green for the following reason.

Invalid breakpoints

If a breakpoint is not placed on an executable line of code, the debugger considers it invalid. For example, a breakpoint set on a comment, a blank line, or declaration is invalid. If you set an invalid breakpoint, the debugger marks the breakpoint invalid and runs. To correct this situation, delete the invalid breakpoint from the Breakpoint List window. You can then set the breakpoint in the intended location. You can, however, also ignore invalid breakpoints; the IDE disables any invalid breakpoints when you run your program.

Aaron
 
Debugging info can be disabled on chunks or units of code by specifing the {$D-} directive. Search your code for that and remove and recompile if you want breakpoints to work.
 
AAronJME

Thank you for your response to this thread but the problem lies in the fact that the debugger has decided that there are no 'Executable Lines' in my unit.

Regards
Stephen
 
This is usually an indication that the .dcu linked to your .exe was not created with the .pas file you are tracing in the ide. You probably hav multiple copies of your source and have the wrong one loaded.

HTH

Roo
Delphi Rules!
 
You can also try Building instead of Compiling your project. This forces all units to be recompiled, and can sometimes fix this issue.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top