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:

Launch

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

Happy debugging!

Comment wrap
Further Reading
Conjucating Certain Capsule Ports in HCL RTist
Secure DevOps | September 11, 2020
Conjugating Certain Capsule Ports in HCL RTist
Protocols in an RTist model are often binary, meaning that there are two connected ports typed by the protocol. The out-events for one of the ports are the in-events for the other port.
Developing Stateful, Event-driven and Real-time Applications
Secure DevOps | September 2, 2020
Developing Stateful, Event-driven and Real-time Applications
HCL RTist is an Eclipse-based modeling and development environment for creating complex, event-driven, real-time applications in C++.
Now Available: RTist 11.0 2020.33
Secure DevOps | August 26, 2020
Now Available: HCL RTist 2020.33
HCL RTist 11 2020.33 is now available with several improvements in various areas.
a/icon/common/search Created with Sketch.