X-Git-Url: http://wien.tomnetworks.com/gitweb/?p=testub10.git;a=blobdiff_plain;f=scripts%2Fdebug_gesamt;fp=scripts%2Fdebug_gesamt;h=7f9c12e0a539afaae3745d918762590140f056c5;hp=0000000000000000000000000000000000000000;hb=029401d51612c5e69d7ac8603e1b69cd7ed6ef96;hpb=bf19094ac2573112418701ba4c6abf5779e3a9f7 diff --git a/scripts/debug_gesamt b/scripts/debug_gesamt new file mode 100755 index 0000000..7f9c12e --- /dev/null +++ b/scripts/debug_gesamt @@ -0,0 +1,72 @@ +#!/bin/bash + +i=$1 +beispiel=gesamt +PROGRAM=./$beispiel + +#LOC=. +LOC=/usr/ftp/pub/ubvl/test/$beispiel + +allow_null_glob_expansion=1 + +if [ ! -d ~/abgabe/$beispiel ]; then + echo "Fehler: Verzeichnis ~/abgabe/$beispiel existiert nicht." + exit 1 +else + cd ~/abgabe/$beispiel + echo 'Teste "make"' + make +fi + +if test ! -x $PROGRAM +then + echo "Fehler: Kein Programm $PROGRAM" + exit 1 +fi +let prgnum=0 +#for i in $LOC/*.0 $LOC2/*.0 +if [ -f $i ]; then + let prgnum=prgnum+1 + let errorfound=0 + echo "==========> Eingabe von $i:" + cat $i + echo + RESFILE=test${beispiel}out$$ + $PROGRAM <$i >$RESFILE + retval=$? + echo -n "Übersetzung: " + if test $retval -eq 0 + then + echo "Status korrekt" + else + echo "[Errot] Status=$retval. Erwartet: 0" + let errorfound=1 + fi + echo + echo "Ausgabe:" + if [ -f ~/test/scripts/clr.py ]; then + cat $RESFILE | ~/test/scripts/clr.py + else + cat $RESFILE + fi + mv -f $RESFILE $RESFILE.s + CALLFILE=${i%.*}.call + echo + if [ ! -f $CALLFILE ]; then + echo "Fehler: Datei $CALLFILE existiert nicht, kann Code nicht ausführen..." + exit 1 + else + echo "Übersetze und linke das Testprogramm:" + if cc -g -I. -DCALL=\"$CALLFILE\" $LOC/testmain.c $LOC/callingconvention.o $RESFILE.s; then + echo + echo "Rufe folgendes Codefragment auf:" + cat $CALLFILE + echo + gdb ./a.out + else + echo "[Error] Erzeugter Code konnte nicht assembliert und gelinkt werden." + let errorfound=1 + fi + fi + rm -f a.out $RESFILE $RESFILE.s +fi