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

Implement official Arduino IDE debugger API #9116

Merged
merged 6 commits into from
Feb 9, 2024

Conversation

pillo79
Copy link
Contributor

@pillo79 pillo79 commented Jan 16, 2024

Description of Change

This PR replaces the current experimental sketch debugging description with a full implementation according to the finalized Arduino Platform Debug Specification.

The current experimental debug configuration will no longer be supported with the release of Arduino IDE 2.3.0.

The biggest improvement is that now the contents of launch.json can be fully customized from entries in platform.txt, so there is no need to copy files in the sketch folder and advanced customizations become possible.

In particular, debug_custom.json is not used anymore.

Tests scenarios

Tested on Arduino Nano ESP32 with current nightly IDE, available from here in the Nightly Builds section, or 2.3.0+ when it becomes public.

Copy link
Contributor

github-actions bot commented Jan 16, 2024

Warnings
⚠️

Some issues found for the commit messages in this PR:

  • the commit message "feat(platform)!: use new Arduino Debug API":
    • body's lines must not be longer than 100 characters
    • summary looks empty
    • type/action looks empty
  • the commit message "on_release: allow single board packages":
    • type/action should be one of [change, ci, docs, feat, fix, refactor, remove, revert, test]

Please fix these commit messages - here are some basic tips:

  • follow Conventional Commits style
  • correct format of commit message should be: <type/action>(<scope/component>): <summary>, for example fix(esp32): Fixed startup timeout issue
  • allowed types are: change,ci,docs,feat,fix,refactor,remove,revert,test
  • sufficiently descriptive message summary should be between 20 to 72 characters and start with upper case letter
  • avoid Jira references in commit messages (unavailable/irrelevant for our customers)

TIP: Install pre-commit hooks and run this check when committing (uses the Conventional Precommit Linter).

⚠️ Please consider squashing your 6 commits (simplifying branch history).

👋 Hello pillo79, we appreciate your contribution to this project!


Click to see more instructions ...


This automated output is generated by the PR linter DangerJS, which checks if your Pull Request meets the project's requirements and helps you fix potential issues.

DangerJS is triggered with each push event to a Pull Request and modify the contents of this comment.

Please consider the following:
- Danger mainly focuses on the PR structure and formatting and can't understand the meaning behind your code or changes.
- Danger is not a substitute for human code reviews; it's still important to request a code review from your colleagues.
- Resolve all warnings (⚠️ ) before requesting a review from human reviewers - they will appreciate it.
- To manually retry these Danger checks, please navigate to the Actions tab and re-run last Danger workflow.

Review and merge process you can expect ...


We do welcome contributions in the form of bug reports, feature requests and pull requests.

1. An internal issue has been created for the PR, we assign it to the relevant engineer.
2. They review the PR and either approve it or ask you for changes or clarifications.
3. Once the GitHub PR is approved we do the final review, collect approvals from core owners and make sure all the automated tests are passing.
- At this point we may do some adjustments to the proposed change, or extend it by adding tests or documentation.
4. If the change is approved and passes the tests it is merged into the default branch.

Generated by 🚫 dangerJS against 246a6d1

@me-no-dev
Copy link
Member

Nice!

@me-no-dev
Copy link
Member

@pillo79 could you also backport this to release/2.x? We will probably have to release 2.0.15 soon with some security fixes (and more)

@pillo79
Copy link
Contributor Author

pillo79 commented Jan 16, 2024

@me-no-dev thanks for looking. Sure, will do! 👍

@pillo79
Copy link
Contributor Author

pillo79 commented Jan 16, 2024

I edited descriptions only, but rebasing to current master (60395ed) I apparently picked up something that causes a build error. I will revert to the previous branch point for the CI to complete.

Use regexs to replace all occurrences of `{runtime.platform.path}` with
the correct `{runtime.tools.*.path}`, regardless of directory separator,
and remove dependency on specific text around each path.

Note that the order has been changed to ensure that the longest paths
are replaced first, to avoid replacing parts of other paths.
Ensure Windows paths properly use a backslash as folder separator.
Implement sketch debugging according to the official Arduino
Platform Debug Specification [1].

The biggest improvement is that now `launch.json` can be fully
customized by the core (including the type of each entry),
so there is no need to copy files in the sketch folder.
In particular, `debug_custom.json` is not used anymore.

[1] https://arduino.github.io/arduino-cli/latest/platform-specification/#sketch-debugging-configuration

BREAKING CHANGE: This commit requires Arduino IDE 2.3.0 or later to use
the debugging features. Older versions will no longer be able to start
a debug session successfully.
Cortex-debug requires objdump to be in the same folder as gdb, or needs
the full path to the executable in the `launch.json` file. This is now
possible with the new debugging API.
If the `debug.executable` variable is null or unset, the Debug button
appears grayed out. The new IDE also takes current parameters into
account, allowing to conditionally enable the Debug button only when
some conditions are met.
@pillo79
Copy link
Contributor Author

pillo79 commented Jan 16, 2024

Fixed a quote-related escaping issue (my personal favs 😅) and also included a small addition to on-release that was present on 2.x but I missed when preparing the 3.x porting. I will test tomorrow with the IDE team then release for actual review/merge.

@kittaakos
Copy link

available from here in the Nightly Builds section,

Direct link: https://www.arduino.cc/en/software#nightly-builds

@VojtechBartoska VojtechBartoska added the IDE: Arduino IDE Issue relates to Arduino IDE label Feb 1, 2024
@pillo79 pillo79 marked this pull request as ready for review February 1, 2024 17:03
@pillo79
Copy link
Contributor Author

pillo79 commented Feb 1, 2024

Internal tests have completed successfully so marking it ready for review.

@VojtechBartoska VojtechBartoska added the Status: Review needed Issue or PR is awaiting review label Feb 2, 2024
@pillo79
Copy link
Contributor Author

pillo79 commented Feb 9, 2024

IDE 2.3 has been released yesterday 👍

@CristianCardosoArellano
Copy link

CristianCardosoArellano commented Mar 28, 2024

Captura de pantalla 2024-03-27 a la(s) 9 30 46 p m
Does not work debugger for esp32-dev module.
embedded:startup.tcl:28: Error: Can't find debug.cfg Arduino IDE 2.3.2

@pillo79
Copy link
Contributor Author

pillo79 commented Mar 28, 2024

Does not work debugger for esp32-dev module. embedded:startup.tcl:28: Error: Can't find debug.cfg Arduino IDE 2.3.2

Hello @cristiancardosodexcom, what is the version of the core you are using? Is that on a Mac?

@CristianCardosoArellano
Copy link

CristianCardosoArellano commented Mar 28, 2024

Does not work debugger for esp32-dev module. embedded:startup.tcl:28: Error: Can't find debug.cfg Arduino IDE 2.3.2

Version: 2.3.2
Date: 2024-02-20T09:53:59.281Z (1 month ago)
CLI Version: 0.35.3

Copyright © 2024 Arduino SA

Yes it's a MAC.

@pillo79
Copy link
Contributor Author

pillo79 commented Mar 29, 2024

I was referring to the version of the Arduino-ESP32 core, not the IDE 🙂
What does the IDE report here?
image
(If you are using a local Git copy, please provide the commit). Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IDE: Arduino IDE Issue relates to Arduino IDE Status: Review needed Issue or PR is awaiting review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants