Hi,
I've looked around for plans on adding support for debugging Python code when running Micropython, but didn't find a whole lot other than someone saying "that's worth discussing" here on the forum.
Are there any plans?
Debugger plans?
Re: Debugger plans?
Can't speak for the authors but I think there's more important work to do at the moment, debugging might not fit in the 'Micro' spirit, and it might not really be needed: in most cases a little bit of knowledge of uPy's internals and knowing how to use your favourite C debugger are just as good, if not better, than an actual python debugger.
-
- Posts: 3
- Joined: Wed Dec 02, 2015 1:30 pm
Re: Debugger plans?
Stepping through the VM is a terribly inefficient way to debug Python code, though… Being able to inspect the current state of variables when something unexpected happens is very handy for figuring out what's gone wrong, as is being able to set a breakpoint at a suspect position in the code and stepping ahead to see what causes something bad.
It's especially useful in embedded applications, the real world (as in chip peripherals, hardware-specific behavior etc) tends to be different from simulated test cases that are supposed to verify the code's correctness.
It's especially useful in embedded applications, the real world (as in chip peripherals, hardware-specific behavior etc) tends to be different from simulated test cases that are supposed to verify the code's correctness.
Re: Debugger plans?
Ping. Any updates?mikaeleiman wrote:Hi,
I've looked around for plans on adding support for debugging Python code when running Micropython, but didn't find a whole lot other than someone saying "that's worth discussing" here on the forum.
Are there any plans?
Re: Debugger plans?
But what if your product is an integration of uPy in an embedded system that uses uPy to do automation?stijn wrote:Can't speak for the authors but I think there's more important work to do at the moment, debugging might not fit in the 'Micro' spirit, and it might not really be needed: in most cases a little bit of knowledge of uPy's internals and knowing how to use your favourite C debugger are just as good, if not better, than an actual python debugger.
You would not want the user to care about the internals, only about the Python script.
Re: Debugger plans?
Issue 3009 discusses PDB integration. In short, it's not trivial but it is possible, particularly for someone with the appropriate experience.