From 00cedaa996ad6c6f36b22d42a3b3000a7d30df14 Mon Sep 17 00:00:00 2001 From: Himbeer Date: Thu, 5 Sep 2024 13:45:52 +0200 Subject: Add test program runner script --- scripts/run.sh | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100755 scripts/run.sh (limited to 'scripts') 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 -- cgit v1.2.3