From 94bcc4bcc1e78d72c4090b6cceb57d30ec95223b Mon Sep 17 00:00:00 2001 From: dzaima Date: Fri, 14 Apr 2023 14:55:59 +0300 Subject: [PATCH] make debugger helpers print to stderr --- src/core/stuff.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/stuff.c b/src/core/stuff.c index d59be283..7a94b53d 100644 --- a/src/core/stuff.c +++ b/src/core/stuff.c @@ -722,10 +722,10 @@ B g_t (void* x) { return tag(x,OBJ_TAG); } B g_ta(void* x) { return tag(x,ARR_TAG); } B g_tf(void* x) { return tag(x,FUN_TAG); } bool ignore_bad_tag; -void g_p(B x) { printI(x); putchar(10); fflush(stdout); } -void g_i(B x) { B r = info_c2(x, m_f64(1), inc(x)); printI(r); dec(r); putchar(10); fflush(stdout); } -void g_pv(void* x) { ignore_bad_tag=true; printI(tag(x,OBJ_TAG)); putchar(10); fflush(stdout); ignore_bad_tag=false; } -void g_iv(void* x) { ignore_bad_tag=true; B xo = tag(x, OBJ_TAG); B r = C2(info, m_f64(1), inc(xo)); printI(r); dec(r); putchar(10); fflush(stdout); ignore_bad_tag=false; } +void g_p(B x) { fprintI(stderr,x); fputc(10,stderr); fflush(stderr); } +void g_i(B x) { B r = info_c2(x, m_f64(1), inc(x)); fprintI(stderr,r); dec(r); fputc(10,stderr); fflush(stderr); } +void g_pv(void* x) { ignore_bad_tag=true; fprintI(stderr,tag(x,OBJ_TAG)); fputc(10,stderr); fflush(stderr); ignore_bad_tag=false; } +void g_iv(void* x) { ignore_bad_tag=true; B xo = tag(x, OBJ_TAG); B r = C2(info, m_f64(1), inc(xo)); fprintI(stderr,r); dec(r); fputc(10,stderr); fflush(stderr); ignore_bad_tag=false; } void g_pst(void) { vm_pstLive(); fflush(stdout); fflush(stderr); } #ifdef DEBUG