Fix regression in overriding remapped debug configuration data via debug_custom.json
#49
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Some of the data from the
arduino-cli debug --info
output does not match exactly with thelaunch.json
format required by the Cortex-Debug VS Code extension used at the Arduino IDE integrated sketch debugger. For this reason, some remapping of the Arduino CLI data is required.The user can adjust the debugger configuration via a debug_custom.json file in the sketch project. The data from this file is merged into the base data provided by
arduino-cli debug --info
. The data from debug_custom.json should override the base data where there is overlap.During the recent reworking of the debugger configuration generation code (#41), a regression was introduced that caused the override to no longer work for the remapped Arduino CLI data. The cause was applying the remapping after merging the
debug_custom.json
data, which resulted in thedebug_custom.json
data being overridden by that subset of the Arduino CLI data.This was not caught by the project's tests because there was no coverage for overrides. I have added coverage and you can see the test fails when ran on the codebase prior to the patch:
https://github.com/arduino/vscode-arduino-tools/actions/runs/8128174502/job/22213780846?pr=49#step:6:159
The bug is fixed by performing the remapping before merging the
debug_custom.json
data.Fixes #48