简体   繁体   English

Delphi7 - 如何找到我的项目挂起编译器的位置?

[英]Delphi7 - How can i find where my project is hanging the compiler?

I have a project in Delphi7. 我在Delphi7中有一个项目。 Its is rather large consisting of 40 odd forms and frames. 它相当大,由40种奇怪的形式和框架组成。 Recently, the compiler only allows me to compile the project once so i can run it, then every re-compile the IDE hangs and i have to end the Delphi process. 最近,编译器只允许我编译一次项目,这样我就可以运行它,然后每次重新编译IDE都会挂起,我必须结束Delphi进程。 Before this occurs, my CPU goes to 50% (on dual core machine) so my deduction is the compilation process has gone into an infinite loop. 在此之前,我的CPU达到50%(在双核机器上),所以我的推论是编译过程已进入无限循环。 The Executable it produces is not runnable and usually at a fixed size after it hangs. 它生成的可执行文件不可运行,并且在挂起后通常具有固定大小。

I was wondering how i can go about finding where this inconsistency in my project is. 我想知道如何才能找到项目中这种不一致的地方。 Other projects do not suffer from this same issue. 其他项目不会遇到同样的问题。

  1. You can use Process Explorer to discover what compiler is doing (reading a file, or ...). 您可以使用Process Explorer来发现编译器正在执行的操作(读取文件或...)。
  2. Check the QC 3807 issue. 检查QC 3807问题。
  3. Check the system resources - free disk space, memory. 检查系统资源 - 可用磁盘空间,内存。 Clean the temp folder. 清理临时文件夹。 Check the disk for errors. 检查磁盘是否有错误。 Do you have antivirus running ? 你有防病毒运行吗? If yes, then try to turn it off. 如果是,请尝试将其关闭。

Use "process of elimination", to see if it's something in your code. 使用“消除过程”,看看它是否在您的代码中。

First, make a backup of where you are, or save to your CVS (you ARE using version control, right? RIGHT? good.) Revert your branch to an earlier version where it worked. 首先,备份你的位置,或保存到你的CVS(你正在使用版本控制,对吗?对吗?好。)将你的分支恢复到它工作的早期版本。 See if that works. 看看是否有效。 If so, merge half of the changes from the present-day version. 如果是这样,请合并当前版本的一半更改。 If that works, try the other half. 如果有效,请尝试另一半。 Keep cutting things in half, and you'll find the code that causes the problem, by process of elimination. 将事情减少一半,你会发现导致问题的代码,通过消除过程。

Or, it may turn out to be something in the configuration. 或者,它可能会成为配置中的某些东西。 Carbonite may be your friend here. Carbonite可能是你的朋友。

You can either: 你可以:

  1. Enable "Compilation progress display" in the "Environment Options" window, in the "Preferences" tab. 在“环境选项”窗口的“首选项”选项卡中启用“编译进度显示”。

  2. Use the command line compiler bcc32.exe to have a detailed console output. 使用命令行编译器bcc32.exe获得详细的控制台输出。

Both will let you know which file is hanging the compiler. 两者都会让你知道哪个文件挂起了编译器。

Take a look at the great Delphi Speed Up tool, which allows eg to abort CodeCompletion and HelpInsight by ESC/mouse move. 看一下伟大的Delphi Speed Up工具,它允许例如通过ESC /鼠标移动来中止CodeCompletion和HelpInsight。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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