A VSCode debugger extension for PlatformIO/Arduino projects with full MI3/MI4 support.
- 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)
- 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
npm install
npm run buildThis extension supports multiple versions of the GDB Machine Interface protocol:
Legacy support for older GDB versions.
- Enhanced multi-location breakpoint support
- Improved handling of template functions and inline code
- Better breakpoint output format
- 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.
- Open your PlatformIO/Arduino project in VSCode
- Set breakpoints in your code
- Start debugging (F5)
- Use the debug toolbar to control execution
- 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)
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"
}- Arduino (AVR, ARM)
- ESP32 / ESP8266
- STM32 (all series)
- Raspberry Pi Pico (RP2040)
- Nordic nRF52
- Other ARM Cortex-M microcontrollers
- ST-Link
- J-Link
- CMSIS-DAP
- Black Magic Probe
- USB-to-Serial adapters (for ESP32/ESP8266)
- Ensure your code is compiled with debug symbols (
-gflag) - Check that GDB version is 7.0 or newer:
gdb --version - Verify OpenOCD is running and connected to your target
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.
- Check that OpenOCD is running:
openocd -f interface/stlink.cfg -f target/stm32f4x.cfg - Verify the target port (default: 3333)
- Check firewall settings
npm run buildnpm testnpm run test:coveragesrc/
├── 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
Contributions are welcome! Please ensure:
- All tests pass:
npm test - Code follows TypeScript best practices
- New features include tests
- Documentation is updated
See LICENSE file for details.
- 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
- Initial release
- MI2 protocol support
- Basic debugging features
- GDB Machine Interface Documentation
- OpenOCD Documentation
- VSCode Debug Adapter Protocol
- PlatformIO Documentation
For issues and feature requests, please use the GitHub issue tracker.