ARM-software / vscode-cmsis-csolution

Extension support for VS Code CMSIS Project Extension
https://marketplace.visualstudio.com/items?itemName=Arm.cmsis-csolution
Other
23 stars 5 forks source link

Improve "Run and Debug" Configuration #82

Open ReinhardKeil opened 1 week ago

ReinhardKeil commented 1 week ago

The "Run and Debug" Configuration of the CMSIS Solution is very flexible, but needs review.

image

This dialog opens on edit - it is a graphic view to launch.json image

jreineckearm commented 1 week ago

@ReinhardKeil , some initial input

Documentation: How are "launch.json" dialogs created (see 2nd picture)

The dialogs are custom webviews provided by a custom text editor in the debug adapter extension. In this case living in the Arm Debugger extension. These allow to either show the text of the VS Code launch.json/tasks.json, or the webview overlay.

Review of parameters

Most of this is handled by the debug adapter extension. In this case the Arm Debugger extension. The debug launch/attach configuration definitions and default configuration providers live there. Hence, changes need to be applied in the Arm Debugger extension.

Flash Algorithms come from DFP and BSP; however just one cmsisPack seems to be possible.

This is a current limitation of the Arm Debugger extension. At the moment cmsisPack defines which pack to extract the required CMSIS device/debug descriptions from. This needs to change in the Arm Debugger extension for the above scenario.

Can defaults be changed (i.e. command:arm-debugger.getApplicationFile)

They can by changing the default configuration providers (https://code.visualstudio.com/api/references/vscode-api#DebugConfigurationProvider and https://code.visualstudio.com/api/references/vscode-api#TaskProvider<T>) which are implemented in the debug adapter extension that contributes the debug configuration type.

In the Arm Debugger extension case, the currently used arm-debugger.getApplicationFile command tries under the hood a couple of known commands from other Arm extensions if present (cmsis-csolution.getBinaryFiles, cmsis-csolution.getBinaryFile) before it scans the folder structure for the first found application file (file endings defined in the Arm Debugger extension settings). image