npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

pioarduino-vscode-debug

v1.1.2

Published

pioarduino debugger for VSCode with MI3/MI4 support

Readme

pioarduino-vscode-debug

A VSCode debugger extension for PlatformIO/Arduino projects with full MI3/MI4 support.

Features

  • GDB-based debugging via Machine Interface (MI) protocol
  • Support for MI2, MI3, and MI4 protocol versions
  • Breakpoint management (including multi-location breakpoints)
  • Variable inspection and modification
  • Memory viewer and editor
  • CPU register inspection
  • Disassembly view
  • Peripheral viewer for embedded systems
  • Call stack navigation
  • Step debugging (step in, step over, step out)

Requirements

  • VSCode: Version 1.82.0 or newer
  • GDB: Version 7.0 or newer (12.0+ recommended for MI4 support)
  • OpenOCD: Version 0.10.0 or newer (0.12.0+ recommended)
  • PlatformIO: For Arduino/embedded development

Installation

npm install
npm run build

GDB/MI Protocol Support

This extension supports multiple versions of the GDB Machine Interface protocol:

MI2 (GDB 7.x - 8.x)

Legacy support for older GDB versions.

MI3 (GDB 9.x - 11.x)

  • Enhanced multi-location breakpoint support
  • Improved handling of template functions and inline code
  • Better breakpoint output format

MI4 (GDB 12.x+)

  • Script field as list for breakpoint commands
  • Latest protocol improvements
  • Recommended for new projects

The extension automatically adapts to the MI version used by your GDB instance. No configuration changes are required.

Usage

  1. Open your PlatformIO/Arduino project in VSCode
  2. Set breakpoints in your code
  3. Start debugging (F5)
  4. Use the debug toolbar to control execution

Debugging Features

  • Breakpoints: Click in the gutter to set/remove breakpoints
  • Conditional Breakpoints: Right-click on a breakpoint to add conditions
  • Watch Variables: Add variables to the watch panel
  • Memory View: Inspect memory contents at specific addresses
  • Disassembly: View assembly code for your functions
  • Registers: Monitor CPU register values
  • Peripherals: View hardware peripheral states (embedded systems)

Configuration

The extension works with standard VSCode launch configurations. Example:

{
  "type": "gdb",
  "request": "launch",
  "name": "PlatformIO Debug",
  "executable": "${workspaceFolder}/.pio/build/target/firmware.elf",
  "target": "localhost:3333",
  "cwd": "${workspaceFolder}",
  "gdbpath": "arm-none-eabi-gdb"
}

Compatibility

Tested Platforms

  • Arduino (AVR, ARM)
  • ESP32 / ESP8266
  • STM32 (all series)
  • Raspberry Pi Pico (RP2040)
  • Nordic nRF52
  • Other ARM Cortex-M microcontrollers

Debug Probes

  • ST-Link
  • J-Link
  • CMSIS-DAP
  • Black Magic Probe
  • USB-to-Serial adapters (for ESP32/ESP8266)

Troubleshooting

Breakpoints not working

  1. Ensure your code is compiled with debug symbols (-g flag)
  2. Check that GDB version is 7.0 or newer: gdb --version
  3. Verify OpenOCD is running and connected to your target

Multi-location breakpoints

If you're debugging template functions or inline code and breakpoints behave unexpectedly, ensure you're using GDB 9.0+ (MI3) for proper multi-location breakpoint support.

Connection issues

  1. Check that OpenOCD is running: openocd -f interface/stlink.cfg -f target/stm32f4x.cfg
  2. Verify the target port (default: 3333)
  3. Check firewall settings

Development

Building

npm run build

Testing

npm test

Test Coverage

npm run test:coverage

Architecture

src/
├── backend/          # GDB communication layer
│   ├── adapter.ts    # Debug adapter implementation
│   ├── mi2/          # MI protocol implementation
│   │   ├── mi2.ts    # MI command interface
│   │   └── types.ts  # MI data types
│   ├── mi_parse.ts   # MI output parser
│   └── symbols.ts    # Symbol management
├── frontend/         # VSCode UI providers
│   ├── configprovider.ts
│   ├── disassembly_*.ts
│   ├── memory_*.ts
│   ├── peripheral.ts
│   └── registers.ts
├── extension.ts      # Extension entry point
└── common.ts         # Shared utilities

Contributing

Contributions are welcome! Please ensure:

  1. All tests pass: npm test
  2. Code follows TypeScript best practices
  3. New features include tests
  4. Documentation is updated

License

See LICENSE file for details.

Changelog

Version 1.1.0

  • Added MI3/MI4 protocol support
  • Enhanced multi-location breakpoint handling
  • Improved compatibility with GDB 9.0+ and 12.0+
  • Added comprehensive breakpoint parsing tests
  • Better error handling for breakpoint operations

Version 1.0.0

  • Initial release
  • MI2 protocol support
  • Basic debugging features

References

Support

For issues and feature requests, please use the GitHub issue tracker.