-
-
Notifications
You must be signed in to change notification settings - Fork 6
Fix regression in overriding remapped debug configuration data via debug_custom.json
#49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some of the data from the `arduino-cli debug --info` output does not match exactly with the launch.json format required by the IDE's debugger. For this reason, some remapping of the data is required. The remapping code is validated by tests. Previously the tests passed the remapping test data via the argument used for the data from the user's debug_custom.json file. This was incorrect since the remapping is specific to the data from Arduino CLI. No remapping is necessary for the debug_custom.json data since this is directly correlated to launch.json and thus will always use the correct data format for direct inclusion in launch.json.
....json Some of the data from the `arduino-cli debug --info` output does not match exactly with the launch.json format required by the IDE's debugger. For this reason, some remapping of the 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`. It is essential that the data from debug_custom.json overrides the base data where there is overlap, yet previously there was no test coverage for this. Since the merging code gives special handling to the remapped Arduino CLI data, it is especially important to provide good coverage for overriding that data.
@per1234
per1234
added
topic: code
Related to content of the project itself
type: imperfection
Perceived defect in any part of project
labels
Mar 3, 2024
Some of the data from the `arduino-cli debug --info` output does not match exactly with the launch.json format required by the IDE's debugger. For this reason, some remapping of the 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. Previously the override did not work for the remapped Arduino CLI data since the remapping was applied after merging the debug_custom.json data, which caused the debug_custom.json data to be overridden by that subset of the Arduino CLI data. The bug is fixed by performing the remapping before merging the debug_custom.json data.
1 task
dankeboy36
dankeboy36
approved these changes
Mar 5, 2024
@dankeboy36
dankeboy36
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, Per!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Uh oh!
There was an error while loading. Please reload this page.
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