HCL SW Blogs
Select Page

If you are building your RTist application with the Visual Studio compiler, you also need to use the Visual Studio IDE for debugging it. Fortunately, it’s very easy to do that. Let’s look at the steps needed to use Visual Studio 2017 to debug an executable that has been created with RTist.

The first step is to set-up the transformation configuration in RTist so the built executable will contain debug symbols. Open the TC editor and go to the Target Configuration tab. Set $(DEBUG_TAG) in Compile Arguments and /DEBUG in Link Arguments.

TC Debug Settings

These two settings are sufficient to be able to debug all generated C++ code. However, if you also need to debug into the TargetRTS code, follow these additional steps.

Now you can build your TC as usual to create the executable.

The next step is to open the generated project folder in Visual Studio. Right-click the generated CDT project in Eclipse and do Properties. Copy the full path to the project that is shown as Location in the Properties dialog. In Visual Studio do File – Open – Folder and paste the copied path in the dialog. Then close the dialog to open the content of the folder in Visual Studio.

Solution Explorer

If you want you can now set some breakpoints in the generated source code. When you are ready to start debugging, right-click the executable in the Solution Explorer and choose Debug.

Debug Menu

The application is launched and can now be debugged in Visual Studio.

If you need to define command-line arguments, environment variables etc for the debugged application you can use the Debug and Launch Settings command in the context menu of the executable. Choose the Native debugger and edit the launch.vs.json file. For example, to prevent that the debugged application runs under the RTist command-line debugger, set the -URTS_DEBUG=quit command-line argument like this:


Use Content Assist (Ctrl + Space) in the above file to learn about more configuration properties you can set.

Happy debugging!

Comment wrap
Further Reading
RTist header
Secure DevOps | September 2, 2022
RTist 11.2 2022.34
HCL RTist is a rule-based code translator for C/C++. The main feature of RTist is to produce readable, maintainable, and portable code.
What’s new in HCL RTist 11.1 2021.46
Secure DevOps | November 29, 2021
What’s new in HCL RTist 11.1 2021.46
HCL release of HCL RTist: 11.1 2021.46. As usual, there are several new features and a few bug fixes. Read more to know some highlights.
HCL Compass Rest APIs In Action
Secure DevOps | November 9, 2021
Writing a generic type descriptor with HCL RTist
Type descriptor provides Metadata about a user-defined type in the model, such as a class, typedef, or type alias. Read to know more.
Filters result by