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
"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",
"trace32Port": 20000
}
]
}
and tasks.json:
{
"version": "2.0.0",
"tasks": [{
"label": "start_debug_adapter",
"command": "start ${workspaceFolder}/t32debugadapter.exe",
"args": [],
"type": "shell"
}]
}
Add a comment