To use Visual Studio Code (VSCode) as a frontend for TRACE32, you can utilize the Debug Adapter Protocol (DAP). Although TRACE32 does not natively support DAP, you can set up a proxy to translate between DAP and TRACE32’s Remote API (RCL). This proxy enables VSCode to function as an effective Front-End for TRACE32, facilitating enhanced debugging capabilities.
Usage
1- You need TRACE32 version Nightly from 2024-07-16 (Build 170887 or later) or starting from the DVD R.2024.09
2- Start TRACE32 with API enabled:
By adding this block to the config file:
RCL=NETTCP
PORT=20000
Or using the command line option (TRACE32 version Nightly from 2024-07-19 (Build 171009 or later)):
-–t32-api-rcl=TCP 20000
Example: t32marm.exe -–t32-api-rcl=TCP 20000 -c config.t32
Or using the PRACTICE commands (TRACE32 version Nightly from 2024-07-19 (Build 170994 or later)):
SETUP.API.RCL /Interface TCP /Port 20000.
3- Open VSCode
4- Add a configuration in VSCode (Menu → Run → Add Configuration → select empty)
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "attach",
"name": "dapserver attach",
"debugServer": 58870,
"cmm": "~~/demo/arm/compiler/arm/cppdemo.cmm", //optional cmm to be called
// "trace32Node": localhost, //IP address
"trace32Port": 20000 //API port
}
]
}
5- Run t32debugadapter.exe in cmd line (can be found under ~~/demo/env/vscode or can be downloaded from our website), or check the Tip below
6- In VSCode, go to RUN AND DEBUG and start the debug of dapserver attach (or just F5)
💡 Tip:
You can automatically start the debug adapter (step 5) by using a preLaunchTask:
launch.json:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "attach",
"name": "start debug adapter and attach",
"preLaunchTask": "start_debug_adapter",
"debugServer": 58870,
"cmm": "~~/demo/arm/compiler/arm/cppdemo.cmm",
// "trace32Node": localhost, //IP address
"trace32Port": 20000
}
]
}
and tasks.json:
{
"version": "2.0.0",
"tasks": [{
"label": "start_debug_adapter",
"command": "start C:/T32/demo/env/vscode/bin/windows64/t32debugadapter.exe", // adjust path as needed
"args": [],
"type": "shell"
}]
}
Comments (14)
The Linux version will be available soon in our website.
For the moment, I will send it via email.
The Linux and Mac versions are available in our website
You can simply call it in a terminal with: “ <PATH>/t32debugadapter”
The error ’InitializeRequestArguments.__init__() got an unexpected keyword argument supportsANSIStyling' is now fixed.
Please use the new version ( v0.0.7) of t32debugadapter available in our website.
You can use the parameters "trace32Node" to set the IP address of the Linux machine. In this case TRACE32 can be started in Linux and VSCode + t32debugadapter in windows.
In this case, you may not see the source file as it is located in the Linux machine.
Please make sure to use v0.0.8 of t32debugadapter