From f1e950d9d8589fd692b0f27bf03fa12614071c20 Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Mon, 25 Feb 2019 20:30:48 +0100 Subject: [PATCH] mes: Make debug levels 4 and 5 usable. * HACKING: Update debug policy. * lib/linux/read.c (read): Print read in level 5. * src/mes.c (eval_apply): Print module in level 6. (main): Likewise. Remove redundant module printing. * src/gc.c (gc): Print symbols in level 6. --- HACKING | 6 ++++-- lib/linux/read.c | 2 +- src/gc.c | 4 ++-- src/mes.c | 24 ++++-------------------- 4 files changed, 11 insertions(+), 25 deletions(-) diff --git a/HACKING b/HACKING index 047e2e3a..740390fa 100644 --- a/HACKING +++ b/HACKING @@ -132,8 +132,10 @@ enough to work on compiling tinycc's tcc.c albeit a somewhat modified version. - list of symbol - opened input strings - gc details - 5) usage of opened input strings - + 5) lots of data + - usage of opened input strings + - bytes read + 6) globals * Bugs ** mes: performance, Mes is now 2-10x slower than Guile. diff --git a/lib/linux/read.c b/lib/linux/read.c index 9c3917c2..9f9ae4af 100644 --- a/lib/linux/read.c +++ b/lib/linux/read.c @@ -22,7 +22,7 @@ ssize_t read (int filedes, void *buffer, size_t size) { ssize_t bytes = _sys_call3 (SYS_read, (int) filedes, (long) buffer, (long) size); - if (__mes_debug () > 3) + if (__mes_debug () > 4) { if (bytes == 1) { diff --git a/src/gc.c b/src/gc.c index 696bcf81..6b822c09 100644 --- a/src/gc.c +++ b/src/gc.c @@ -225,7 +225,7 @@ gc_ () ///((internal)) SCM gc () { - if (g_debug > 4) + if (g_debug > 5) { eputs ("symbols: "); write_error_ (g_symbols); @@ -237,7 +237,7 @@ gc () gc_push_frame (); gc_ (); gc_pop_frame (); - if (g_debug > 4) + if (g_debug > 5) { eputs ("symbols: "); write_error_ (g_symbols); diff --git a/src/mes.c b/src/mes.c index b54bd4a6..6b0aafa5 100644 --- a/src/mes.c +++ b/src/mes.c @@ -1547,7 +1547,7 @@ begin_expand: push_cc (input, r2, r0, cell_vm_return); x = read_input_file_env (r0); - if (g_debug > 3) + if (g_debug > 5) module_printer (m0); gc_pop_frame (); input = r1; @@ -2307,7 +2307,7 @@ main (int argc, char *argv[]) m0 = make_initial_module (a); g_macros = make_hash_table_ (0); - if (g_debug > 3) + if (g_debug > 5) module_printer (m0); SCM program = read_boot (); @@ -2334,7 +2334,7 @@ main (int argc, char *argv[]) } if (g_debug) { - if (g_debug > 3) + if (g_debug > 5) module_printer (m0); eputs ("\ngc stats: ["); @@ -2345,25 +2345,9 @@ main (int argc, char *argv[]) eputs (" => "); eputs (itoa (g_free)); eputs ("]\n"); - if (g_debug > 3) - module_printer (m0); eputs ("\n"); - gc (g_stack); - eputs (" => "); - eputs (itoa (g_free)); - eputs ("]\n"); - if (g_debug > 3) - module_printer (m0); - eputs ("\n"); - - gc (g_stack); - eputs (" => "); - eputs (itoa (g_free)); - eputs ("]\n"); - if (g_debug > 3) - module_printer (m0); - if (g_debug > 3) + if (g_debug > 5) { eputs ("ports:"); write_error_ (g_ports);