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).
Is there a way to run Delphi with debug DCUs, but without the System unit?
When you enable Debug DCUs, all you are really doing is changing the DCU search path. Specifically that the paths specified by the Debug DCU Path option are used when searching for .dcu files.
So, you could create a new directory and add it to the front of the list of paths in the Debug DCU Path option. Into that directory place the standard System.dcu that does not contain debug symbols.
...\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.Repeat for the other plaforms: replace win32
with any of these, depending on the Delphi version you are running.
android
iosDevice
iossimulator
osx32
win64
Edit 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.
Currently supported languages I know of:
de
(German)fr
(French)jp
(Japanese)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.
It works fine for any unit in the release
versus debug
branch of the platforms.
Edit 3:
If your Delphi version does not suffer from Library path overwrites, then you can use Davids suggestion with these steps:
$(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\$(LANGDIR);
to $(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
.
I've tested this with Delphi XE3 and XE5 on all supported platforms and it works. In XE and XE2, I sometimes hat parts of the search paths overwritten with wrong values, so I prefer the first method there.
The picture below is for Delphi XE3 and the OSX.
It supports the English debugging DCUs and the translated debugging DCUS.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With