diff options
author | Damien George <damien@micropython.org> | 2024-03-07 11:38:27 +1100 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2024-06-21 16:21:27 +1000 |
commit | 9dbc787ce8dda9df39eb68c03de144155b2253f0 (patch) | |
tree | f05e960eb7f1bc173570c2bca0901524ed813407 /py/compile.c | |
parent | e2ae03e97963c2d338752bc4cbe8bd87981014fb (diff) | |
download | micropython-9dbc787ce8dda9df39eb68c03de144155b2253f0.tar.gz micropython-9dbc787ce8dda9df39eb68c03de144155b2253f0.zip |
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>
Diffstat (limited to 'py/compile.c')
-rw-r--r-- | py/compile.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/py/compile.c b/py/compile.c index 9b012f8787..3429e384c0 100644 --- a/py/compile.c +++ b/py/compile.c @@ -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 |