py: Integrate sys.settrace feature into the VM and runtime.
This commit adds support for sys.settrace, allowing to install Python handlers to trace execution of Python code. The interface follows CPython as closely as possible. The feature is disabled by default and can be enabled via MICROPY_PY_SYS_SETTRACE.
This commit is contained in:
committed by
Damien George
parent
c96aedad46
commit
310b3d1b81
@@ -284,6 +284,9 @@ STATIC void emit_write_bytecode_byte_raw_code(emit_t *emit, int stack_adj, byte
|
||||
assert(c == MP_ALIGN(c, sizeof(void*)));
|
||||
*c = rc;
|
||||
#endif
|
||||
#if MICROPY_PY_SYS_SETTRACE
|
||||
rc->line_of_definition = emit->last_source_line;
|
||||
#endif
|
||||
}
|
||||
|
||||
// unsigned labels are relative to ip following this instruction, stored as 16 bits
|
||||
|
||||
Reference in New Issue
Block a user