Skip to content
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

feat: allow boards to change debug support via FQBN options #2436

Closed
wants to merge 1 commit into from

Conversation

pillo79
Copy link
Contributor

@pillo79 pillo79 commented Nov 24, 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?

"debug.executable" must be present AND non-empty for debugging to be supported, allowing board overrides. Also, use the same logic in the details view and in the actual debug command implementation.

What is the current behavior?

Debug support is enabled if any of the txt files define a key named debug.executable, regardless of its contents, preventing overrides by board and/or menu options

What is the new behavior?

"debug.executable" must be present AND non-empty for debugging to be supported, allowing board overrides. Also, use the same logic in the details view and in the actual debug command implementation.

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

No, it is backwards compatible (all cores using debug define the key to a valid string, cores without debug never define the key).

Other information

Tested with Arduino Nano ESP32 package.
Original platform.txt already contains:

debug.executable={build.path}/{build.project_name}.elf 

Lines added to boards.txt:

nano_nora.debug.executable=   
nano_nora.menu.USBMode.hwcdc.debug.executable={build.path}/{build.project_name}.elf   
  • Output from arduino-cli board details -b arduino-git:esp32:nano_nora --format json does not include debugging_supported key.
  • Output from arduino-cli board details -b arduino-git:esp32:nano_nora:USBMode=hwcdc --format json includes "debugging_supported": true.

@CLAassistant
Copy link

CLAassistant commented Nov 24, 2023

CLA assistant check
All committers have signed the CLA.

"debug.executable" must be present AND non-empty for debugging to be
supported, allowing board overrides. Also, use the same logic in the
details view and in the actual debug command implementation.
Copy link

codecov bot commented Nov 24, 2023

Codecov Report

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

Comparison is base (4bf81fd) 67.28% compared to head (957ceae) 67.30%.

Files Patch % Lines
commands/debug/debug_info.go 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2436      +/-   ##
==========================================
+ Coverage   67.28%   67.30%   +0.01%     
==========================================
  Files         210      210              
  Lines       20568    20573       +5     
==========================================
+ Hits        13840    13846       +6     
+ Misses       5588     5587       -1     
  Partials     1140     1140              
Flag Coverage Δ
unit 67.30% <88.88%> (+0.01%) ⬆️

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.

@umbynos umbynos requested a review from cmaglie November 24, 2023 14:27
@umbynos umbynos added type: enhancement Proposed improvement topic: code Related to content of the project itself labels Nov 24, 2023
@cmaglie
Copy link
Member

cmaglie commented Nov 24, 2023

Thanks for the PR @pillo79!

After merging #2435 the "debugging supported" is much more complex to determine and it depends also on the programmer selected.

We agreed that the "debugging supported" should no longer be a property of the board.
You can determine if debugging is supported by calling GetDebugConfig (if the call succeeds then the debugging is supported).

@cmaglie cmaglie closed this Nov 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in 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.

4 participants