aboutsummaryrefslogtreecommitdiff
path: root/scripts/run.sh
blob: a1997aeb714737ca9a04b7fb97daf9dbe1f87a9d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/bin/sh

# SPDX-FileCopyrightText: 2024 Himbeer <himbeer@disroot.org>
#
# SPDX-License-Identifier: CC0-1.0

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