py/emitndebug: Add native debug emitter.
This emitter prints out pseudo-machine instructions, instead of the usual
output of the native emitter. It can be enabled on any port via
`MICROPY_EMIT_NATIVE_DEBUG` (make sure other native emitters are disabled)
but the easiest way to use it is with mpy-cross:
$ mpy-cross -march=debug file.py
Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
@@ -103,6 +103,7 @@ static const emit_method_table_t *emit_native_table[] = {
|
||||
&emit_native_xtensa_method_table,
|
||||
&emit_native_xtensawin_method_table,
|
||||
&emit_native_rv32_method_table,
|
||||
&emit_native_debug_method_table,
|
||||
};
|
||||
|
||||
#elif MICROPY_EMIT_NATIVE
|
||||
@@ -121,6 +122,8 @@ static const emit_method_table_t *emit_native_table[] = {
|
||||
#define NATIVE_EMITTER(f) emit_native_xtensawin_##f
|
||||
#elif MICROPY_EMIT_RV32
|
||||
#define NATIVE_EMITTER(f) emit_native_rv32_##f
|
||||
#elif MICROPY_EMIT_NATIVE_DEBUG
|
||||
#define NATIVE_EMITTER(f) emit_native_debug_##f
|
||||
#else
|
||||
#error "unknown native emitter"
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user