[add recomp.prl and debug.gdb utility helpers
John Meacham <john@repetae.net>**20070227075153] addfile ./utils/debug.gdb
hunk ./utils/debug.gdb 1
+define detag
+    print (void *)((uintptr_t)$arg0 & ~0x3)
+end
+
+
+define pnode
+        if ((uintptr_t)$arg0 & 1)
+        printf "--- lazy node %p %p\n", $arg0, ((uintptr_t)$arg0 & ~0x3)
+        if (((node_t *)((uintptr_t)$arg0 & ~0x3))->tag & 1)
+        printf "--- unevaled node\n"
+        else
+        printf "--- indirection\n"
+        end
+        printf "tag: %p\n", ((node_t *)((uintptr_t)$arg0 & ~0x3))->tag
+        printf "a1: %p\n", ((node_t *)((uintptr_t)$arg0 & ~0x3))->rest[0]
+        printf "a2: %p\n", ((node_t *)((uintptr_t)$arg0 & ~0x3))->rest[1]
+
+        else
+        printf "--- WHNF node %p\n", $arg0
+        printf "tag: %p %u\n", ((node_t *)$arg0)->tag, ((node_t *)$arg0)->tag
+        printf "a1:  %p %u\n", ((node_t *)$arg0)->rest[0], ((node_t *)$arg0)->rest[0]
+        printf "a2:  %p %u\n", ((node_t *)$arg0)->rest[1], ((node_t *)$arg0)->rest[1]
+        printf "a3:  %p %u\n", ((node_t *)$arg0)->rest[2], ((node_t *)$arg0)->rest[2]
+        end
+
+end
addfile ./utils/recomp.prl
hunk ./utils/recomp.prl 1
+#!/usr/bin/perl
+
+unshift @ARGV,"hs.out_code.c" unless $ARGV[0] =~ /^[^-]/;
+
+open IN, "<$ARGV[0]";
+
+shift @ARGV;
+
+while (<IN>) {
+    /jhc_c_compile\[\] = \"(.*)\";/ or next;
+    my $cmd = ("$1 " . (join " ",@ARGV));
+    print "; $cmd\n";
+    exec $cmd or die "can't exec";
+
+}
+
+die "couldn't recompile";