diff options
| author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-05-05 00:50:05 +0300 |
|---|---|---|
| committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-05-05 00:57:00 +0300 |
| commit | 6b344d781666240c396659d0c4a012412a9b32da (patch) | |
| tree | d3914c5822cafd455ecd2cf08d41d45e5de4cf79 /py/emitglue.c | |
| parent | 4187068cad7a68e54db86eabb115d18fc55d590e (diff) | |
py, unix: Add -v option, print bytecode dump if used.
This will work if MICROPY_DEBUG_PRINTERS is defined, which is only for
unix/windows ports. This makes it convenient to user uPy normally, but
easily get bytecode dump on the spot if needed, without constant recompiles
back and forth.
TODO: Add more useful debug output, adjust verbosity level on which
specifically bytecode dump happens.
Diffstat (limited to 'py/emitglue.c')
| -rw-r--r-- | py/emitglue.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/py/emitglue.c b/py/emitglue.c index 231e32ac2..ed3b385d9 100644 --- a/py/emitglue.c +++ b/py/emitglue.c @@ -96,9 +96,11 @@ void mp_emit_glue_assign_byte_code(mp_raw_code_t *rc, byte *code, uint len, uint DEBUG_printf(" %02x", code[i]); } DEBUG_printf("\n"); -#if MICROPY_DEBUG_PRINTERS - mp_byte_code_print(code, len); #endif +#if MICROPY_DEBUG_PRINTERS + if (mp_verbose_flag > 0) { + mp_byte_code_print(code, len); + } #endif } |
