Creating a debug version of the vcl package
Ever have a package-based application that has been affected by a bug in the VCL? If so, you'll know how difficult it can be to hunt it down. I had one recently, so I began searching for exactly how to debug into the VCL source when using packages. Oddly, I found very little info on the subject. Fortunately, I found enough info and knew enough myself already to achieve it. Here's how, as it applies Delphi 7. For other versions of Delphi, use the corresponding suffix, eg 50 for Delphi 5, 60 for Delphi 6 etc, in place of 70.
1. Start a new package, by clicking File|New|Other, select the “Package” icon and click OK.
2. Click File|New|Form
3. Press Ctrl-F9 to compile the package. The package will compile with warnings, and present a dialog with changes necessary to your package, namely adding a reference to vcl. Click OK to accept the changes, and Delphi will add the reference, and finish compiling the package.
4. In the “Requires” branch of the package, double click the reference to vcl. It will take a while to generate, so be patient. Note that Delphi automatically generates the list of units that the package contains.
5. Press Ctrl-S to bring up the Save dialog. You will need to give the package a name other than vcl.dpk. I chose to name mine vcl70.dpk. You'll be able to change it back in a later step. Save the package somewhere appropriate.
6. Click the “Options“ button in the package editor, select the “Description” tab and change the LIB suffix value to: 70. Select the “Compiler” tab, and check the “Use debug DCUs” checkbox.
7. Click File|Save As and change the name of the package to vcl.dpk
8. Close Delphi
9. In the Windows System32 directory, rename vcl70.bpl to vcl70.borl.bpl. In the Delphi Lib directory, rename vcl.dcp to vcl.borl.dcp
10. Copy the following files from the Delphi Lib directory to the Delphi LibDebug directory
11. Bring up a command prompt (eg click Start|Run, type cmd and press enter), and change directory to where you saved the vcl.dpk package
12. Use the following command to compile the package:
13. Copy the resulting vcl70.bpl to the Windows System32 directory, and copy the resulting vcl.dcp to the Delphi Lib directory.
That completes building the debug vcl package. You'll need to rebuild the packages in your project that use the vcl so that you can debug into the vcl source.
Please login first in order for you to submit comments
- Page :