Skip to content

Added debug check command to check if a combination of board/programmer supports debugging. #2443

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 8 commits into from
Dec 1, 2023

Conversation

cmaglie
Copy link
Member

@cmaglie cmaglie commented Nov 28, 2023

Please check if the PR fulfills these requirements

See how to contribute

  • The PR has no duplicates (please search among the Pull Requests
    before creating one)
  • The PR follows
    our contributing guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • UPGRADING.md has been updated with a migration guide (for breaking changes)
  • configuration.schema.json updated if new parameters are added.

What kind of change does this PR introduce?

Adds the debug check command (and its gRPC counterpart) to verify if a combination of board/programmer supports debugging. The command also returns the debug_fqbn which is the FQBN without the board options that do not affect the debugger configuration.

What is the current behavior?

What is the new behavior?

$ arduino-cli debug check -b arduino:samd:mkr1000
Missing programmer
$ arduino-cli debug check -b arduino:samd:mkr1000 -P atmel_ice
The given board/programmer configuration supports debugging.
$ arduino-cli debug check -b arduino:samd:mkr1000 -P atmel_ice --format json
{
  "debugging_supported": true,
  "debug_fqbn": "arduino:samd:mkr1000"
}
$ arduino-cli debug check -b arduino:avr:uno -P atmel_ice
The given board/programmer configuration does NOT support debugging.
$ arduino-cli debug check -b arduino:avr:uno -P atmel_ice --format json
{
  "debugging_supported": false
}

Does this PR introduce a breaking change, and is titled accordingly?

Other information

@cmaglie cmaglie added type: enhancement Proposed improvement topic: code Related to content of the project itself labels Nov 28, 2023
@cmaglie cmaglie added this to the Arduino CLI v0.35.0 milestone Nov 28, 2023
@cmaglie cmaglie self-assigned this Nov 28, 2023
Copy link

codecov bot commented Nov 28, 2023

Codecov Report

Attention: 25 lines in your changes are missing coverage. Please review.

Comparison is base (ab03161) 67.38% compared to head (d27c408) 67.54%.

Files Patch % Lines
commands/debug/debug_info.go 76.05% 11 Missing and 6 partials ⚠️
commands/daemon/debug.go 0.00% 3 Missing ⚠️
internal/cli/debug/debug_check.go 93.47% 2 Missing and 1 partial ⚠️
arduino/cores/fqbn.go 60.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2443      +/-   ##
==========================================
+ Coverage   67.38%   67.54%   +0.15%     
==========================================
  Files         210      211       +1     
  Lines       20591    20712     +121     
==========================================
+ Hits        13876    13990     +114     
- Misses       5578     5583       +5     
- Partials     1137     1139       +2     
Flag Coverage Δ
unit 67.54% <82.87%> (+0.15%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@cmaglie cmaglie force-pushed the debug-info-no-check branch from 72089f8 to d27c408 Compare November 29, 2023 10:17
@cmaglie cmaglie merged commit d41da43 into arduino:master Dec 1, 2023
@cmaglie cmaglie deleted the debug-info-no-check branch December 1, 2023 15:35
cmaglie added a commit that referenced this pull request Dec 1, 2023
…mmer supports debugging. (#2443)

* Moved rcp message to proper position

* Added gRPC command to check for debugger support

* Made debug flags var non-global

* Implementation of 'debug check' command

* Implementation of cli command 'debug check'

* added integration test

* Renamed field for clarity

* Added minimum debug_fqbn computation in 'debug check' command
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants