Q:

How to make IDE's breakpoints work with specific DCU folder?

For more organization, I want Delphi to generate DCUs in a different folder of my app's root (c:\app).
So i edited Project > Options > Unit output directory to 'dcu'.
It worked, now all DCUs goes to c:\app\dcu.
But now all my breakpoints show as red X and won't work anymore, they show as the image below when i run the app : 

If i remove 'dcu' from Unit output directory , the breakpoints work again.
Can't i use a specific unit output directory AND breakpoints ?
Thanks !

A:

The red cross means that Delphi can't find a .DCU file that contains debug information for the current UNIT. Somehow your definition of directories in various settings are resulting in this issue.
The "Output directory" specifies where Delphi places the .EXE/.DLL and .DCU files. The output directory can be overridden specifically for .DCU files with the "Unit output directory". If neither is defined, the files are output to the same directory as the source file (.DPR for the .EXE/.DLL file, .PAS for the .DCU file). If only the "Output directory" is specified, both the .EXE/.DLL and the .DCU files are going there.
The "Search Path" where Delphi will search for them. On my setup, I don't need the .DCU output path to be specified here in order for the IDE to locate the .DCU file, so there must be something else in your settings that interferes. But putting the same (relative) directory in "Unit output directory" and including it in the "Search path" should be an effective way to ensure that the IDE can find the .DCU files it itself generates.

