Compiling Delphi XE2 - XE5 Applications With Debug Information

Applies to TestComplete 15.63, last modified on April 23, 2024

Debug Info Agent™ exposes public, published, protected and private members of objects in Delphi applications as soon as the application is compiled with debug information. This topic explains how to include debug information into applications created with Embarcadero Delphi XE2 - XE5. To learn how to prepare applications created with other Delphi versions, see Implementing Debug Info Agent™ Support in Applications.

Note: Debug Info Agent™ is incompatible with tools that change the debug information format. An example of such a tool is EurekaLog 7. We recommend that you disable EurekaLog when compiling an application aimed for automated testing with TestComplete. Otherwise, you will be unable to access private, protected and public methods and properties of your Delphi applications from tests.

Below are detailed instructions on changing the project options to use the desired format of debug information.

  1. Open your project in Embarcadero Delphi XE2 – XE5.

  2. Activate the configuration that you use to build the debug version of your application. To do this, right-click the Project_Name | Build Configurations | Debug Configuration node in the Project Manager and select Activate from the context menu.

    Note: You can build your application in any configuration, not just in the debug one. We recommend that you use the debug configuration to make sure the changes made to the compiler settings will not affect the release configuration that is typically used to build the final version of applications.
  3. Choose Project | Options from the main menu to open the Project Options dialog.

  4. In the Build Configuration combo box, select your debug configuration. This will quickly load the settings used for debug builds.

  5. Select the Delphi Compiler | Compiling category and do the following:

    • In the Code generation group, set the Optimization option to false.

    • In the Debugging group, set the Debug information, Local symbols and Use debug .dcus options to true.

    Project Options: Compiling
    Note: You can keep the Local symbols set to false, but in this case the names of some method parameters will not be displayed in the Object Browser panel.
  6. Switch to the Delphi Compiler | Linking category and set the Debug information option to true:

    Project Options: Linking
  7. (For 32-bit applications only) The Delphi compiler can store generated debug information in separate .tds files or in the TD32 format which is compiled into the application’s binary modules. Debug Info Agent™ can work with both formats.

    If you want to store debug information to a separate TDS file, set the Place debug information in separate TDS file option to true:

    Project Options: Linking

    Some notes concerning this approach:

    • The .tds files containing debug information must reside in the same folders that the appropriate modules of the tested application.

    • Even if the application is compiled with the Local symbols option enabled, the names of some method parameters may not be displayed in the Object Browser. If viewing parameter names is important to you (for instance, if you are developing new tests), compile the tested Delphi application with internal debug information.

    • There is no need to distribute the generated .tds files with your application.

  8. It is recommended that you turn off the Link with runtime packages option in the Packages | Runtime Packages category:

    Project Options: Packages

    If this property is checked, Embarcadero Delphi creates Borland package library (.bpl) files when compiling the application. TestComplete cannot access debug information in these files and some controls. If this property is unchecked, all information is included in a single executable and can be accessed by TestComplete. For more information about runtime packeges, see About Runtime Packages.

    If, for some reason, you cannot turn off the Build with runtime packages option, TestComplete may not be able to get access to the application's internal methods and properties. To resolve the problem, enable the Read debug information for statically linked libraries project option in TestComplete.
  9. Click OK to save the changes and close the Project Options dialog.

  10. Re-compile the application.

Remember to recompile the release version of your application without debug information in order to reduce the application size.

See Also

Debug Info Agent™
Debug Info Agent™ Specifics
Testing Delphi Applications - Overview

Highlight search results