Description
sys.settrace
is a great step towards having a usable MicroPython debugger, but as long as it's not possible to query local variables, people can't replace their print-debugging with a debugger based on sys.settrace
.
My proposal is to somehow expose locals when sys.settrace
is enabled. It doesn't need to be a Dict[str, Any]
. If the exact rules are published for mapping local names to positions in an array, the debugger can still present a conventional view to the user. It's alright if some locals (eg. created by constant expressions) don't end up in this array at all, as long as the rules are clear.
If something like this gets done, then I'd do my best to create a beginner-friendly MicroPython debugger for Thonny IDE.