diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-12-28 21:41:58 +0200 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-12-28 21:43:44 +0200 |
commit | 1ee1785bed2dc899d92c15047face797f859f1c9 (patch) | |
tree | fc0cebb9e2647a84fdcf731acf0bcc7388eb4d73 /py/showbc.c | |
parent | df103462dc5dedc066ce1d448cf29aee48d1bf55 (diff) | |
download | micropython-1ee1785bed2dc899d92c15047face797f859f1c9.tar.gz micropython-1ee1785bed2dc899d92c15047face797f859f1c9.zip |
showbc: Print operation mnemonic in BINARY_OP.
Diffstat (limited to 'py/showbc.c')
-rw-r--r-- | py/showbc.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/py/showbc.c b/py/showbc.c index e25b050c68..4a765499cf 100644 --- a/py/showbc.c +++ b/py/showbc.c @@ -34,6 +34,7 @@ #include "runtime.h" #include "bc0.h" #include "bc.h" +extern const qstr mp_binary_op_method_name[]; #if MICROPY_DEBUG_PRINTERS @@ -509,7 +510,8 @@ const byte *mp_bytecode_print_str(const byte *ip) { } else if (ip[-1] < MP_BC_UNARY_OP_MULTI + 5) { printf("UNARY_OP " UINT_FMT, (mp_uint_t)ip[-1] - MP_BC_UNARY_OP_MULTI); } else if (ip[-1] < MP_BC_BINARY_OP_MULTI + 35) { - printf("BINARY_OP " UINT_FMT, (mp_uint_t)ip[-1] - MP_BC_BINARY_OP_MULTI); + mp_uint_t op = ip[-1] - MP_BC_BINARY_OP_MULTI; + printf("BINARY_OP " UINT_FMT " %s", op, qstr_str(mp_binary_op_method_name[op])); } else { printf("code %p, byte code 0x%02x not implemented\n", ip, ip[-1]); assert(0); |