summaryrefslogtreecommitdiff
path: root/py/runtime.c
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2017-12-09 01:26:21 +0200
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2017-12-09 01:28:16 +0200
commit39dd89fe3142478b48d7282b8b1bdff933c25f32 (patch)
tree17e58826bd0d41e71e69b2be866dd545415b0ad3 /py/runtime.c
parentc0877cbb0d51f66fa828f6df5698751210391296 (diff)
py/runtime: When tracing unary/binary ops, output op (method) name.
E.g.: >>> 1+1 binary 26 __add__ 3 3 Output is similar to bytecode dump (numeric code, then op name).
Diffstat (limited to 'py/runtime.c')
-rw-r--r--py/runtime.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/py/runtime.c b/py/runtime.c
index c7fe39367..457266c67 100644
--- a/py/runtime.c
+++ b/py/runtime.c
@@ -214,7 +214,7 @@ void mp_delete_global(qstr qst) {
}
mp_obj_t mp_unary_op(mp_unary_op_t op, mp_obj_t arg) {
- DEBUG_OP_printf("unary " UINT_FMT " %p\n", op, arg);
+ DEBUG_OP_printf("unary " UINT_FMT " %q %p\n", op, mp_unary_op_method_name[op], arg);
if (op == MP_UNARY_OP_NOT) {
// "not x" is the negative of whether "x" is true per Python semantics
@@ -275,7 +275,7 @@ mp_obj_t mp_unary_op(mp_unary_op_t op, mp_obj_t arg) {
}
mp_obj_t mp_binary_op(mp_binary_op_t op, mp_obj_t lhs, mp_obj_t rhs) {
- DEBUG_OP_printf("binary " UINT_FMT " %p %p\n", op, lhs, rhs);
+ DEBUG_OP_printf("binary " UINT_FMT " %q %p %p\n", op, mp_binary_op_method_name[op], lhs, rhs);
// TODO correctly distinguish inplace operators for mutable objects
// lookup logic that CPython uses for +=: