Skip to content

Use new GDB 16.2 #154

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
merged 7 commits into from
Apr 30, 2025
Merged

Use new GDB 16.2 #154

merged 7 commits into from
Apr 30, 2025

Conversation

Jason2866
Copy link

@Jason2866 Jason2866 commented Apr 30, 2025

Description:

Related issue (if applicable): fixes #

Checklist:

  • The pull request is done against the latest develop branch
  • Only relevant files were touched
  • Only one feature/fix was added per PR, more changes are allowed when changing boards.json
  • I accept the CLA

Summary by CodeRabbit

  • New Features

    • Added support for additional ESP32 board variants in the Arduino WiFi scan example, enabling easier setup for esp32-s2, esp32-s3, esp32-c2, esp32-c3, and esp32-c6 boards.
  • Chores

    • Updated debugger tool packages to use new sources and versions for improved compatibility.
    • Streamlined and centralized toolchain and debug tool configuration for various MCUs, enhancing reliability and maintainability.

Copy link

coderabbitai bot commented Apr 30, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

This update introduces several enhancements and reorganizations across configuration and platform management files. The platformio.ini file for the Arduino WiFi scan example now includes new build environments for various ESP32 board variants, specifying their respective platforms, frameworks, and upload protocols. The platform.json file updates the ownership and version sources of two debugger tool packages, switching to new owners and GitHub-hosted release URLs. The platform.py file undergoes significant refactoring, consolidating toolchain and debug tool configuration into a structured mapping, improving error handling, and removing redundant code blocks.

Changes

File(s) Change Summary
examples/arduino-wifiscan/platformio.ini Added new build environments for esp32-s2, esp32-s3, esp32-c2, esp32-c3, and esp32-c6 boards with specified platform, framework, upload protocol, and monitor speed.
platform.json Updated owner fields for tool-xtensa-esp-elf-gdb and tool-riscv32-esp-elf-gdb from platformio to pioarduino; changed version fields from version strings to GitHub release URLs.
platform.py Refactored toolchain and debug tool configuration into a centralized mapping; improved error handling in install_tool; consolidated and removed redundant configuration logic.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant PlatformConfig (platform.py)
    participant ToolchainMapping
    participant DebugToolInstaller

    User->>PlatformConfig: Initiate package configuration
    PlatformConfig->>ToolchainMapping: Retrieve MCU-specific toolchain/debug mapping
    PlatformConfig->>PlatformConfig: Iterate over mapping to enable required toolchains
    PlatformConfig->>DebugToolInstaller: Install debug tools and OpenOCD if needed
    DebugToolInstaller->>PlatformConfig: Return installation status
    PlatformConfig->>User: Complete configuration
Loading

Poem

In the garden of code, new boards now appear,
With toolchains mapped neatly, the process is clear.
Debuggers find homes from new URLs fetched,
While error logs blossom where once bugs were etched.
Hooray for the tidy, the mapped, and the new—
This rabbit hops forward, with platforms in view! 🐇✨


🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@Jason2866
Copy link
Author

@coderabbitai full review

Copy link

coderabbitai bot commented Apr 30, 2025

✅ Actions performed

Full review triggered.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (2)
examples/arduino-wifiscan/platformio.ini (1)

15-50: Reduce duplication with a shared [env] base section

All new environments share identical platform, framework, upload_protocol, and monitor_speed entries. A small refactor keeps the file compact and makes future tweaks less error-prone:

[env]
platform        = espressif32
framework       = arduino
upload_protocol = esp-builtin
monitor_speed   = 115200

[env:esp-wrover-kit]
board = esp-wrover-kit

[env:esp32-s2]
board = esp32-s2-saola-1
…
platform.py (1)

74-78: Broaden exception handling during package.json copy

Good call adding error handling. shutil.copyfile can also raise PermissionError or a generic OSError (e.g. on read-only filesystems). Catching the wider tuple prevents an early abort while still surfacing the underlying issue.

-                    except FileNotFoundError as e:
-                        sys.stderr.write(f"Error copying tool package file: {e}\n")
+                    except (FileNotFoundError, PermissionError, OSError) as e:
+                        sys.stderr.write(f"Error copying tool package file: {e}\n")
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5d9d8c7 and f17f13c.

📒 Files selected for processing (3)
  • examples/arduino-wifiscan/platformio.ini (1 hunks)
  • platform.json (1 hunks)
  • platform.py (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (19)
  • GitHub Check: build (macos-15, examples/arduino-blink)
  • GitHub Check: build (macos-15, examples/espidf-arduino-matter-light)
  • GitHub Check: build (windows-latest, examples/espidf-storage-sdcard)
  • GitHub Check: build (windows-latest, examples/arduino-zigbee-switch)
  • GitHub Check: build (windows-latest, examples/espidf-hello-world)
  • GitHub Check: build (ubuntu-24.04, examples/espidf-coap-server)
  • GitHub Check: build (windows-latest, examples/espidf-arduino-blink)
  • GitHub Check: build (windows-latest, examples/arduino-matter-light)
  • GitHub Check: build (windows-latest, examples/tasmota)
  • GitHub Check: build (ubuntu-24.04, examples/espidf-peripherals-uart)
  • GitHub Check: build (windows-latest, examples/arduino-zigbee-light)
  • GitHub Check: build (ubuntu-24.04, examples/espidf-blink)
  • GitHub Check: build (ubuntu-24.04, examples/tasmota)
  • GitHub Check: build (ubuntu-24.04, examples/espidf-arduino-blink)
  • GitHub Check: build (ubuntu-24.04, examples/espidf-arduino-matter-light)
  • GitHub Check: build (windows-latest, examples/arduino-wifiscan)
  • GitHub Check: build (windows-latest, examples/arduino-usb-keyboard)
  • GitHub Check: build (ubuntu-24.04, examples/arduino-blink)
  • GitHub Check: build (ubuntu-24.04, examples/arduino-wifiscan)
🔇 Additional comments (1)
platform.py (1)

145-149: Condition misses the common build_type = debug variant

variables.get("build_type") returns the string value ("debug"), yet PlatformIO sets "build_type" to that same literal.
However, many workflows rely on the boolean test if build_type == "debug":.
To be future-proof, gate on the exact value:

-                if (variables.get("build_type") or "debug" in "".join(targets)) ...
+                if (variables.get("build_type") == "debug" or "debug" in "".join(targets)) ...

@Jason2866 Jason2866 changed the title Use new GDB 16.2 and refactoring Use new GDB 16.2 Apr 30, 2025
@Jason2866 Jason2866 merged commit f03a984 into develop_33 Apr 30, 2025
1 check passed
@Jason2866 Jason2866 deleted the devel33_new_gdb branch April 30, 2025 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant