aboutsummaryrefslogtreecommitdiff
path: root/scripts/run.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/run.sh')
-rwxr-xr-xscripts/run.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/scripts/run.sh b/scripts/run.sh
new file mode 100755
index 0000000..a6e6b62
--- /dev/null
+++ b/scripts/run.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+GDB="gdb"
+
+go run . < "$1" | qbe | as -o /tmp/test.o
+ld -o /tmp/test -I /lib64/ld-linux-x86-64.so.2 -lc /lib/crt1.o /tmp/test.o
+/tmp/test
+echo "Exit code: $?"
+echo "disassemble main" | ${GDB} /tmp/test