Jump to content
PiedSoftware

Delphi has stopping on break points and exceptions

Recommended Posts

Hi


I have a break point, but when I run the procedure it is in the code is going right past it and putting up a message a few lines down. 
 

Also, I had a bug where the code was throwing an exception, the exception dialog would come up, but the debugger didn't stop at the relevant line.

I have been googling and poking around in the settings but nothing has shown up that would make it stop at the line. I have deleted and recreated the break point, rebooted my machine, and it looks as if Delphi is broken, but I hope not!

 

This is Delphi 10.4, building for windows32.

Share this post


Link to post

Try clicking Debug in Project manager, first.  

 

Screenshot 2023-09-12 225017.png

 

Be sure the compiled lines have blue dot in left gutter.

You may be able to click on lines in the call stack in in debug layout. This backs up the procedure calls in the code window.  

Edited by Pat Foley
added call stack

Share this post


Link to post

I had a look at the list of breakpoints (View | Debug windows | Breakpoint) and I had accumulated a couple of dozen, a number from files that have been removed from the project. I deleted all of them, and put back in the one that I wanted. And now it is great to see my program stopping on the line I have asked it to stop on.

Share this post


Link to post

I've seen it happen as well. Sometimes doing a clean build and clearing/resetting the breakpoints will sort the issue out.  

Share this post


Link to post

I did clean builds a number of times, and it didn't clear the problem. What made the difference was clearing all the breakpoints, one after the other, the putting back in the one I wanted to use. 

Share this post


Link to post

It's happening again. There must be some other cause. I tried another smaller project. The breakpoints worked a few times and then stopped.

Edited by PiedSoftware

Share this post


Link to post

More checks

The provenance (path) of used units found in hint box showing when mousing over tabs over unit tabs in code window or control tabs on the component bar.    

 

Then the transactions in .proj.local can be looked at.  These transactions log when units renamed or who knows. 

 

Try syntax check or build all from time to time can't hurt!

Share this post


Link to post
On 9/15/2023 at 1:21 PM, Pat Foley said:

More checks

 The provenance (path) of used units found in hint box showing when mousing over tabs over unit tabs in code window or control tabs on the component bar.    

  

Then the transactions in .proj.local can be looked at.  These transactions log when units renamed or who knows. 

  

Try syntax check or build all from time to time can't hurt!

I see the correct file names in the popup hint over the tabs for each unit.
If the syntax was wrong it wouldn't even build and run. I am doing Build fairly frequently.

Share this post


Link to post

I am using 11.3 a big improvement over 10.4 until the blue moon last month. Then the IDE began doing disappearing act like 10.3, after "upgrading" an event in a control in a package. In short recompiling my package of custom controls fixed the issue(s).  Looking at the output messages after a compile I may shut down the OneDrive business if the IDE crashes while hovering over the Search menu again.    

 

  

 

    

Share this post


Link to post

Thanks. I would hope I can fix the issue with something less drastic than reinstalling. What advantages do you have with 11.3?

Share this post


Link to post

I think I may have solved the problem. 
Somehow the normal run button got replaced with the Run without debugging button. So far the best explanation is that when I had the problem was when I ran the program by hitting the Run button, and when it ran fine it was because I hit F9. I don't remember changing it, and I don't remember whether I hit F9 or the button each time I had breakpoints or not, But, now I am back in happy land.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×