[英]Is there a way to enable Debug DCUs without including the System unit?
Using the debug DCUs in Delphi is really nice, except for the fact that the System unit adds a lot of overhead around method initialization/cleanup (releasing interfaces, clearing arrays, walking exception frames, etc). 在Delphi中使用调试DCU非常好,除了系统单元在方法初始化/清理(释放接口,清除数组,行走异常帧等)时增加了很多开销。
Is there a way to run Delphi with debug DCUs, but without the System unit? 有没有办法用调试DCU运行Delphi,但没有系统单元?
When you enable Debug DCUs, all you are really doing is changing the DCU search path. 启用调试DCU时,您所做的只是更改DCU搜索路径。 Specifically that the paths specified by the Debug DCU Path option are used when searching for .dcu files.
特别是在搜索.dcu文件时使用Debug DCU Path选项指定的路径 。
So, you could create a new directory and add it to the front of the list of paths in the Debug DCU Path option. 因此,您可以创建一个新目录并将其添加到“调试DCU路径”选项中的路径列表的前面。 Into that directory place the standard System.dcu that does not contain debug symbols.
在该目录中放置不包含调试符号的标准System.dcu。
...\\Embarcadero\\RAD Studio\\10.0\\lib\\win32\\debug\\System.dcu
...\\Embarcadero\\RAD Studio\\10.0\\lib\\win32\\debug\\System.dcu
...\\Embarcadero\\RAD Studio\\10.0\\lib\\win32\\release\\System.dcu
to ...\\Embarcadero\\RAD Studio\\10.0\\lib\\win32\\debug\\System.dcu
...\\Embarcadero\\RAD Studio\\10.0\\lib\\win32\\release\\System.dcu
to ...\\Embarcadero\\RAD Studio\\10.0\\lib\\win32\\debug\\System.dcu
System.dcu
file. System.dcu
文件。 Repeat for the other plaforms: replace win32
with any of these, depending on the Delphi version you are running. 重复其他平台:将
win32
替换为其中任何一个,具体取决于您运行的Delphi版本。
android
iosDevice
iossimulator
osx32
win64
Edit 2: 编辑2:
Repeat for the other supported languages than English: replace debug
and release
with debug\\##
and release\\##
for each of the languages ##
you want to use. 重复其他支持的语言而不是英语:用
debug\\##
替换debug
和release
,并为你想要使用的每种语言##
release\\##
。
Currently supported languages I know of: 目前支持的语言我知道:
de
(German) de
(德国) fr
(French) fr
(法文) jp
(Japanese) jp
(日文) Edit: 编辑:
This way works well, even if an installation sequence messes up your search paths like that happened to me more than once in the Delphi XE / XE2 era. 这种方式运行良好,即使安装顺序混淆了您在Delphi XE / XE2时代不止一次发生的搜索路径。
It works fine for any unit in the release
versus debug
branch of the platforms. 它适用于平台的
release
与debug
分支中的任何单元。
Edit 3: 编辑3:
If your Delphi version does not suffer from Library path overwrites, then you can use Davids suggestion with these steps: 如果您的Delphi版本没有遭受库路径覆盖,那么您可以使用Davids建议执行以下步骤:
$(BDSLIB)\\$(Platform)\\nodebug;$(BDSLIB)\\$(Platform)\\debug\\$(LANGDIR);
$(BDSLIB)\\$(Platform)\\nodebug;$(BDSLIB)\\$(Platform)\\debug\\$(LANGDIR);
to the Delphi Debug DCU Path. $(BDSLIB)\\$(Platform)\\release
to $(BDSLIB)\\$(Platform)\\nodebug
for all the above mentioned platforms. $(BDSLIB)\\$(Platform)\\release
$(BDSLIB)\\$(Platform)\\nodebug
到$(BDSLIB)\\$(Platform)\\nodebug
用于所有上述平台。 $(BDSLIB)\\$(Platform)\\release\\$(LANGDIR);
$(BDSLIB)\\$(Platform)\\release\\$(LANGDIR);
复制您不想调试的任何非英语语言单元$(BDSLIB)\\$(Platform)\\release\\$(LANGDIR);
to $(BDSLIB)\\$(Platform)\\nodebug\\$(LANGDIR);
$(BDSLIB)\\$(Platform)\\nodebug\\$(LANGDIR);
for all the above mentioned platforms. The nodebug
directories do not have to be in the $(BDSLIB)
realm, but it is really convenient to keep the $(Platform)
as it is easier to support other platforms than Win32
. nodebug
目录不必位于$(BDSLIB)
领域,但保留$(Platform)
非常方便,因为它比Win32
更容易支持其他平台。
I've tested this with Delphi XE3 and XE5 on all supported platforms and it works. 我已经在所有支持的平台上使用Delphi XE3和XE5进行了测试,并且它可以工作。 In XE and XE2, I sometimes hat parts of the search paths overwritten with wrong values, so I prefer the first method there.
在XE和XE2中,我有时会用错误的值覆盖搜索路径的某些部分,因此我更喜欢第一种方法。
The picture below is for Delphi XE3 and the OSX. 下图是针对Delphi XE3和OSX的。
It supports the English debugging DCUs and the translated debugging DCUS . 它支持英语调试DCU和翻译后的调试DCUS 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.