From 90713100c2a9ef07943aaf3e396e599106d02db6 Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Tue, 4 Feb 2014 18:38:32 +0900 Subject: [PATCH] show argument values when entering OP_CALL --- src/vm.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/vm.c b/src/vm.c index d9cd024b..b04b263c 100644 --- a/src/vm.c +++ b/src/vm.c @@ -561,13 +561,17 @@ pic_apply(pic_state *pic, struct pic_proc *proc, pic_value argv) proc = pic_proc_ptr(x); #if VM_DEBUG - puts("== calling proc..."); + puts("\n== calling proc..."); printf(" proc = "); pic_debug(pic, pic_obj_value(proc)); puts(""); - printf(" argv = "); - pic_debug(pic, argv); - puts(""); + printf(" argv = ("); + for (short i = 1; i < c.u.i; ++i) { + if (i > 1) + printf(" "); + pic_debug(pic, pic->sp[-c.u.i + i]); + } + puts(")"); if (! proc->cfunc_p) { printf(" irep = "); pic_dump_irep(pic, proc->u.irep); @@ -575,7 +579,7 @@ pic_apply(pic_state *pic, struct pic_proc *proc, pic_value argv) else { printf(" cfunc = %p\n", (void *)proc->u.cfunc); } - puts(""); + puts("== end\n"); #endif ci = PUSHCI();