Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

python-ecosys/debugpy: Add VS Code debugging support for MicroPython. #1022

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

Open
andrewleech wants to merge 5 commits into micropython:master
base: master
Choose a base branch
Loading
from andrewleech:add-debugpy-support
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test_vscode: Add global variables to show vaiable tracking and hover.
Signed-off-by: Jos Verlinde <jos_verlinde@hotmail.com>
  • Loading branch information
Josverl authored and andrewleech committed Jun 15, 2025
commit 9adb8862608210bb79a632c70d4d68c56c56981e
6 changes: 6 additions & 0 deletions python-ecosys/debugpy/test_vscode.py
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@
"""Test script for VS Code debugging with MicroPython debugpy."""

import sys

sys.path.insert(0, '.')

import debugpy

foo = 42
bar = "Hello, MicroPython!"

def fibonacci(n):
"""Calculate fibonacci number (iterative for efficiency)."""
if n <= 1:
Expand All @@ -17,13 +21,15 @@ def fibonacci(n):

def debuggable_code():
"""The actual code we want to debug - wrapped in a function so sys.settrace will trace it."""
global foo
print("Starting debuggable code...")

# Test data - set breakpoint here (using smaller numbers to avoid slow fibonacci)
numbers = [3, 4, 5]
for i, num in enumerate(numbers):
print(f"Calculating fibonacci({num})...")
result = fibonacci(num) # <-- SET BREAKPOINT HERE (line 26)
foo += result # Modify foo to see if it gets traced
print(f"fibonacci({num}) = {result}")
print(sys.implementation)
import machine
Expand Down

AltStyle によって変換されたページ (->オリジナル) /