Is there a way to enable Debug DCUs without including the System unit?

delphi

Solution

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.

Problem

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?

Original source