Search found 3 matches

by zamniah
Tue Mar 24, 2020 4:07 pm
Forum: Development of MicroPython
Topic: Trying to write MicroPython debugger via sys.settrace
Replies: 6
Views: 4008

Re: Trying to write MicroPython debugger via sys.settrace

So after some digging in the code, the "fastn" in py/vm.c is the array of the local variables. So far I figured out how to do "repr" on a local variables while inside the VM (on load/store), like: (gdb) call (mp_obj_str_t*)mp_builtin_repr(fastn[MP_BC_STORE_FAST_MULTI - (mp_int_t)ip[-1]]) $6 = (mp_ob...
by zamniah
Sat Mar 21, 2020 11:09 pm
Forum: Development of MicroPython
Topic: Trying to write MicroPython debugger via sys.settrace
Replies: 6
Views: 4008

Re: Trying to write MicroPython debugger via sys.settrace

Yes it's conceptually the same idea. The compiler just maps all local variables to indicies and allocates enough stack for that many slots. In the bytecode you these correspons to the load/store "fast" ops. Is there a way inside micropython to at least get to this array of local variables, albeit n...
by zamniah
Fri Mar 20, 2020 2:00 pm
Forum: Development of MicroPython
Topic: Trying to write MicroPython debugger via sys.settrace
Replies: 6
Views: 4008

Trying to write MicroPython debugger via sys.settrace

I am attempting to write a debugger for MicroPython that would work on x86 unix port. Idea was to be able follow stack (this is possible and would allow breakpoints) and be able to inspect variables, along with an "eval shell". The latter - inspecting variables and eval - doesn't work since there is...