简体   繁体   中英

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 !

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM