Atozed Forums

Full Version: IDE Debugger not working
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
For some time that I'm to report this.
I have many code, many .pas files that the debugger do not work at all.
For instance, if I mark a certain line break, let's suppose, line #10, the debugger never reachs that line, never break on that line. For that to work, I must mark a line break, 4 ou 5 lines above, I that way it will break there, wich is very annoying and confusing. Some times on a short procedure, it will will break or stop at a line after the end of that procedure.

Anyone with this issue?
(07-15-2021, 09:34 AM)Comograma Wrote: [ -> ]For some time that I'm to report this.
I have many code, many .pas files that the debugger do not work at all.
For instance, if I mark a certain line break, let's suppose, line #10, the debugger never reachs that line, never break on that line. For that to work, I must mark a line break, 4 ou 5 lines above, I that way it will break there, wich is very annoying and confusing. Some times on a short procedure, it will will break or stop at a line after the end of that procedure.

Anyone with this issue?

I had that problem a long time ago, I found that Delphi was linking dcu files in another directory, NOT linking the new dcu files created by the new source code.   Delphi was happy to do that (no errors or warnings), but was confused about the code locations.

Search your machine for dcu's (or libs) that may contain code other than what you are compiling now.

Dan
This is a long standing bug in the IDE. It is not specific to IntraWeb.

This can be caused if you have multiple DCUs for a single .pas file in the path, or even without it.

Usually performing a full clear on the project group and rebuilding it will fix it. Usually....

I see this a lot, and its very annoying.
Waste 4 hours and can't figure it out what it is. Very annoying indeed!!!!!!!!!!!!!!!
Sometimes restarting the IDE fixes it too..... Yes.. its immensely annoying and its been around for well over 10 years.
First you need to identify if this is something caused by the environment or it's project-specific.

- Restart the IDE (I'd even restart the machine itself, it won't hurt).
- Create a new blank project (VCL standard application).
- Add a button to it, add an event to its OnClick.
- Put a breakpoint there and try to debug it.

See if it works.

If it doesn't work, you have a IDE/compiler issue. In this case I recommend you to open the global options and check one by one. Check all paths in Library Path settings as well.

If it works, try to do the same with the other (the original) project. See if it works now.
If it doesn't work, you have a project-specific issue.

One of the best ways to fix this is:
- close your IDE
- rename your .DPROJ file to something else (so you can restore it later)
- Start the IDE again and open the project (you will need to select the .DPR file instead, because there won't be a .DPROJ file anymore)
- Delphi will create a new default .DPROJ file for you when you save your project, using the default options
- Now, try to build the project again and debug it. It will very likely work now (if the test using the standard VCL empty project also worked, of course)
- If it works, there is something wrong with your original settings. I suggest you to get rid of that file and use the newly created one.

Other things to try:

- Delete all files generated by the compiler for this project: .DCU, .MAP, .EXE, whatever is generated, delete it manually
- Change the folder used for output (both DCU and BIN folders)
- Double check if you don't have a duplicate folder containing the same code base (a slightly different working version of the same code base will create this exact same mess)
- Build the project and try again
Well, this only happens with Intraweb projects, not with a single standard VCL applications.
I must investigate this more accurate.
(07-19-2021, 05:59 PM)Comograma Wrote: [ -> ]Well, this only happens with Intraweb projects, not with a single standard VCL applications.
I must investigate this more accurate.

Just FYI, I ran into this issue before I even started using IW.   Apparently it can be caused by other things but in my case it was specifically due to having more than one object (dcu) file that did not match the source file.

So, if you have a repeatable case that you can test with then note that unit name and do a rigorous search of your machine (including network paths) to see if there are multiple source or object files.   Also look for object files that may be in linked components.

I have found this to be the problem in every case I've run into.

Dan
(07-19-2021, 05:59 PM)Comograma Wrote: [ -> ]Well, this only happens with Intraweb projects, not with a single standard VCL applications.
I must investigate this more accurate.

Any IW project?

I suggest you open your IDE options and check the library path. Check if you have multiple IW versions in there. Some clean up should fix it.