Skip to content
Snippets Groups Projects

Use an emulator (QEMU) to run "simple"

Merged Sven Tennie requested to merge wip/supersven/simple-with-emulator into master
2 files
+ 28
7
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 20
7
@@ -4,19 +4,32 @@ set -e -x
TEST_GHC="${TEST_GHC:-ghc}"
CABAL="${CABAL:-cabal}"
# QEMU executable
EMULATOR="${EMULATOR:-}"
rm -Rf dist-newstyle
args=(
"-w$TEST_GHC"
"--ghc-options=$@"
"--disable-optimization"
"-v3"
)
"$CABAL" build "${args[@]}" simple
exe="$("$CABAL" list-bin "${args[@]}" simple)"
"$CABAL" build "${args[@]}" -v3 simple
exe=$("$CABAL" list-bin "${args[@]}" simple)
gdb "$exe" \
-ex "break test" \
-ex "run" \
-ex "disassemble"
echo "Using executable: $exe"
if [ -n $EMULATOR ]; then
$EMULATOR -g 1111 $exe &
gdb \
-ex "file $exe" \
-ex "break test" \
-ex "target remote localhost:1111" \
-ex "continue" \
-ex "disassemble"
else
gdb "$exe" \
-ex "break test" \
-ex "run" \
-ex "disassemble"
fi
Loading