[Collapse]TestComplete/viewarticle/63445/
 [Expand]General Information/viewarticle/63445/
 [Expand]Using Help System/viewarticle/55799/
 [Expand]Getting Started Tutorial/viewarticle/56246/
 [Expand]Using TestComplete/viewarticle/57875/
 [Expand]Testing Types/viewarticle/62721/
 [Collapse]Applications Testing/viewarticle/62606/
  [Expand]About Open Applications/viewarticle/55489/
  [Collapse]Desktop/viewarticle/63920/
   [Expand].NET/viewarticle/56853/
   [Expand]WPF/viewarticle/55216/
   [Expand]Visual C++/viewarticle/60932/
   [Expand]Visual Basic 6/viewarticle/62841/
   [Collapse]Delphi/viewarticle/56053/
     Testing Delphi Applications - Overview/viewarticle/55227/
     Requirements for Testing Delphi Applications/viewarticle/58083/
    [Collapse]Preparing Delphi Applications for Testing/viewarticle/57055/
      When You Need to Prepare Delphi Applications/viewarticle/62796/
      Compiling Delphi XE4 Applications With Debug Information/viewarticle/62665/
      Compiling Delphi XE3 Applications With Debug Information/viewarticle/62648/
      Compiling Delphi XE2 Applications With Debug Information/viewarticle/62656/
      Compiling Delphi XE Applications With Debug Information/viewarticle/62664/
      Compiling Delphi 2010 Applications With Debug Information/viewarticle/62645/
      Compiling Delphi 2009 Applications With Debug Information/viewarticle/62649/
      Compiling Delphi 2007 Applications With Debug Information/viewarticle/62666/
      Compiling Delphi 2006 Applications With Debug Information/viewarticle/62644/
      Compiling Delphi 7 and 2005 Applications With Debug Information/viewarticle/62660/
      About StripTDS/viewarticle/55458/
     Addressing Objects in Delphi Applications/viewarticle/57291/
     Support for Delphi Applications' Controls/viewarticle/62797/
     Accessing Native Properties and Methods of Delphi Objects/viewarticle/62779/
     Troubleshooting Delphi Applications/viewarticle/62798/
   [Expand]C++Builder/viewarticle/56052/
   [Expand]Java/viewarticle/57396/
   [Expand]JavaFX/viewarticle/55495/
   [Expand]Windows Store/viewarticle/56253/
   [Expand]ClickOnce/viewarticle/55757/
   [Expand]Qt/viewarticle/55399/
   [Expand]PowerBuilder/viewarticle/56890/
   [Expand]FoxPro/viewarticle/56889/
   [Expand]Microsoft Access/viewarticle/56886/
   [Expand]Microsoft InfoPath/viewarticle/56887/
   [Expand]Console/viewarticle/55407/
  [Expand]Web and RIA/viewarticle/63941/
  [Expand]Mobile/viewarticle/63714/
  [Expand]Miscellaneous/viewarticle/63934/
 [Expand]Working With Application Objects and Controls/viewarticle/55815/
 [Expand]Samples and Tutorials/viewarticle/56239/
 [Expand]References/viewarticle/57878/
 [Expand]Other Tools That Help You Test Better/viewarticle/63442/
 [Expand]TestComplete 10 Licensing Guide/viewarticle/63451/
Updated: 4/23/2014 Applies To: TestComplete 10 Rating: No votes Click to rate: PoorNot badAverageGoodExcellent
Preparing Delphi Applications for Testing

About StripTDS

This topic provides an overview of the StripTDS utility, explains how it works and describes its command line and exit codes.

StripTDS - Overview

StripTDS is a simple command-line utility that strips TD32 debug information from executables and libraries created with the Delphi compiler and saves it in separate TDS files. Thus, it enables you to create release builds of Delphi applications with external debug information. The utility is shipped with TestComplete and can be found in the <TestComplete>\Bin folder.

By default, Delphi Applications expose their run-time type information (RTTI), that is, published properties, to TestComplete. The higher level of “openness” can be reached by compiling the application with debug information included. In this case, TestComplete’s Debug Info Agent™ will read this information and provide access to public, protected and private elements of the application under test.

The Delphi compiler uses the TD32 format of debug information, which is compiled directly in the executable modules and libraries. This means, that to be able to perform white-box testing of a Delphi application with the Debug Info Agent™ assistance, you need to build a special debug version of the application. The StripTDS utility frees you from this limitation. It lets you strip debug information from compiled modules and save it to external TDS files. In this way, you can create release builds of Delphi applications with debug information kept in separate files.

We recommend that you run the StripTDS utility as a part of the application’s build process. For example, if you use CodeGear Delphi 2007 or 2009 or Embarcadero Delphi 2010 or XE, you could invoke StripTDS from the post-build event of your project. If you use an automated build tool such as Automated Build Studio, you could run StripTDS right after the build step that performs the application’s compilation.

The .tds files generated by StripTDS must reside in the same folders that the appropriate modules of the application under test. However, there is no need to distribute them with your application.

How StripTDS Modifies Binary Modules

The StripTDS utility modifies tested modules. Many TestComplete customers are afraid to ship these modules to their end-users since they are not aware what change the utility does. Don't be afraid. StripTDS changes binary modules by removing debug information from them, it does not change binary code. Let’s see how this is done.

Each executable module - EXE, DLL or any other binary module (PE file in Windows terminology) - consists of sections. The sections contain various information and are used for various purposes. Some of the sections contain binary code generated by the compiler, this code is executed when the section is loaded in memory. Some other sections contain data (like string constants or integer values) that are used by the binary code. One more section type holds helper information and is used for helper purposes.

Delphi compiler generates debug information in TD32 format and stores it to special sections within the resulting PE file. Delphi places debug information into the sections that are located at the end of the file. StripTDS reads debug information from these sections and saves it into a separate .tds file. Then it removes the debug information sections from the PE module and corrects the module’s headers so that they contain the appropriate info. That is, StripTDS only works with sections that store debug info. It does not touch the code and data sections, so your application will work the way it was programmed.

StripTDS Command Line

The command line of the StripTDS utility is as follows:

StripTDS.exe [-r] [-w] module [TDS_file]

module

The name of the compiled module that contains TD32 debug information to be stripped off. If you need to process several modules, use wildcards (* and ?) to specify a mask. For example, the *.exe mask matches all EXE files. To match all files, use the * mask.

TDS_file

This argument is only used if module holds a single file name. It specifies the name of the TDS file to which the extracted debug information should be saved. The destination folder for the TDS file must exist on the disk.

If you do not specify this parameter, the debug information will be saved to a file with the same name as module but with the .tds extension.

This argument is ignored if module specifies a file mask or the -r argument is used.

You can specify both absolute file paths (starting with the drive letter) and paths that are relative to the current working folder (not necessarily the StripTDS folder). Using absolute paths is recommended.

If a file path includes spaces, it must be enclosed in quotes, for example, "C:\My App\MyApp.exe".

-r (or /r)

If this argument is specified, StripTDS will process the files specified by the module argument as well as the appropriate files in all subfolders of the folder that contains the module file(s).

-w (or /w)

If this argument is specified, StripTDS will overwrite existing TDS file(s).

Here are some examples of running the StripTDS utility:

  • The following command removes the debug information from the C:\MyApp\MyApp.exe file and saves it to the TDS file of the same name. If the TDS file already exists, it is overwritten:

    "C:\Program Files\SmartBear\TestComplete 10\Bin\StripTDS.exe" /w C:\MyApp\MyApp.exe
  • The following command removes the debug information from the C:\MyApp\MyApp.exe file and saves it to the C:\DebugInfo\MyApp\MyApp.tds file. If the TDS file already exists, it is left unchanged:

    "C:\Program Files\SmartBear\TestComplete 10\Bin\StripTDS.exe" C:\MyApp\MyApp.exe C:\DebugInfo\MyApp\MyApp.tds
  • The following command removes the debug information from all EXE and DLL files in the C:\MyApp folder and all its subfolders and saves it to the TDS files of the same name in the appropriate folders. Existing TDS files are overwritten:

    "C:\Program Files\SmartBear\TestComplete 10\Bin\StripTDS.exe" /r /w C:\MyApp\*.exe;C:\MyApp\*.dll

StripTDS Exit Codes

StripTDS uses the following exit codes:

Code Description
0 The debug information was stripped off successfully.
Non-zero An error occurred during debug information extraction. For example, the specified module does not contain TD32 debug information or contains invalid or unknown debug information.
See also
Testing Delphi Applications | Testing Delphi Applications - Overview | Debug Info Agent™


© 2014 SmartBear Software. All rights reserved.
Email Send feedback on this document