No debugging mode / reliance on print-based debugging #18709
Replies: 1 comment
-
|
Allow me to throw a different light on a few assumptions There already is sys.setrace built in, just not enabled by default. The reason for it not being enabled by default is that debugging has a significant overhead (equally so on CPython) but MCU's by definition have less surplus cpu / memory There are a few active PRs to improve performance, and add capabilities. But having a full featured, and full speed debugger would be very nice indeed. Also see: https://youtu.be/FkWtkQgiDmc?si=plXvmy98RGfbfzVC Also it is often quite possible to run / debug / unittest MicroPython modules on CPython, through modular design, and or mocking parts of the hardware. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I would like to ask about the absence of a proper debugging mode in MicroPython.
Currently, debugging MicroPython applications mostly relies on print() statements. While this can work for very small scripts, it becomes extremely cumbersome and inefficient in larger or more complex projects.
In most mainstream programming languages, debugging tools are considered essential and typically allow:
stepping through code,
inspecting variable values at runtime,
checking memory/state,
Relying entirely on print() for debugging is not only slow and error-prone, but also makes diagnosing complex issues unnecessarily difficult.
My question is:
Why is debugging support not considered important for MicroPython?
Are there technical limitations that make this infeasible?
Is proper debugging support planned, or intentionally out of scope?
From a developer experience perspective, this is one of the main reasons why adopting MicroPython for larger projects feels risky.
Beta Was this translation helpful? Give feedback.
All reactions