如何使IDE的断点与特定的DCU文件夹配合工作?

huangapple go评论70阅读模式
英文:

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

问题

为了更好地组织,我希望Delphi将DCUs生成到我的应用程序根目录(c:\app)的不同文件夹中。

所以我编辑了项目 > 选项 > 单元输出目录为'dcu'。

它起作用了,现在所有的DCUs都放在c:\app\dcu中。

但是现在所有我的断点都显示为红色的X,不再工作,当我运行应用程序时显示如下图所示:

如何使IDE的断点与特定的DCU文件夹配合工作?

如果我从单元输出目录中移除'dcu',断点就可以正常工作了。

我不能使用特定的单元输出目录和断点吗?

谢谢!

英文:

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 :

如何使IDE的断点与特定的DCU文件夹配合工作?

If i remove 'dcu' from Unit output directory , the breakpoints work again.

Can't i use a specific unit output directory AND breakpoints ?

Thanks !

答案1

得分: 0

红色十字标志表示Delphi找不到包含当前UNIT调试信息的.DCU文件。某种方式,您在各种设置中对目录的定义导致了这个问题。

"输出目录" 指定了Delphi放置.EXE/.DLL和.DCU文件的位置。可以使用 "单元输出目录" 明确为.DCU文件指定输出目录。如果两者都没有定义,那么文件将输出到与源文件相同的目录(.DPR用于.EXE/.DLL文件,.PAS用于.DCU文件)。如果只有 "输出目录" 被指定,那么.EXE/.DLL和.DCU文件都会放在那里。

"搜索路径" 是Delphi将在其中搜索这些文件的地方。在我的设置中,我不需要在这里指定.DCU输出路径,以便IDE能够定位.DCU文件,因此必须是您的设置中有其他干扰因素。但是,在 "单元输出目录" 中放置相同的(相对)目录并将其包含在 "搜索路径" 中应该是确保IDE能够找到自己生成的.DCU文件的有效方法。

英文:

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.

huangapple
  • 本文由 发表于 2020年1月3日 19:48:00
  • 转载请务必保留本文链接:https://go.coder-hub.com/59578087.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定