Debug with CodeSite

Overview

The is a RAD Studio IDE plug-in that allows you to right click on an identifier in the code editor and add a breakpoint containing a CodeSite.Send() evaluation expression which the send a message CodeSite during debugging.

This is a useful technique for debugging code you cannot or should not alter like the RTL/VCL.

The idea behind this comes from my post Debugging RTL/VCL Code with CodeSite and Stefan Glienke asking if it could be done through an OTA plug-in.

Options

There are a few options for the plug-in as shown below.

These options are as follows:

  • A message temple that should contain a least 1 %s to be replaced. Each occurance of %s will be replaced with the identifier.
  • Check that CodeSiteLogging is in the DPR/DPK unit list;
  • Check that the project has Debugging DCUs checked;
  • Check that CodeSite path is in the library (this is current unimplemented due to issues getting the information from the IDE);
  • Log the Result of the CodeSite breakpoint to the event log;
  • Break at the CodeSite breakpoint;
  • Edit the breakpoint after its added.

Usage

The usage is hopefully simple. You can either place the cursor over an identifier and that identifier (including any simple qualification) will be added to the breakpoint or you can select some text and that will be added to the breakpoint (updated with version 1.1).

As you should be able to see above the selected identifier is added to both the CodeSite.Send() label and the variable as the template contained 2 %s (default).

Download

The currently built DLLs and source code for RAD Studio XE, XE2, XE7, XE8, 10 Seattle, 10.1 Berlin and 10.2 Tokyo can be downloaded from the below link:

Please refer to the page Compiling and installing my RAD Studio IDE plug-ins for information on compiling missing versions and installing the packages. You may find that you can compile this for earlier versions of the IDE than shown above however you will need to open the frame in order to remove some properties that were introduced in later IDE (See Chapter 17: Options Page(s) inside the IDE’s Options Dlg for more information).