#! /bin/sh -f

ROM_DIR=/usr/server/rom/HOTL2


    # If you want to have logs in a different directory,
    #   change the 'logfile=' line to reflect the directory name.
    # (It isn't used but I let it in anyway)

    coreindex=30
    while [ 1 ]
    do
        corefile=$ROM_DIR/log/rom-core.$coreindex
        if [ -r $corefile ]
        then
			cd $ROM_DIR/area
			exec gdb $ROM_DIR/src/rom $ROM_DIR/log/$corefile
        fi

        coreindex=`echo $coreindex - 1|bc`
        if [ $coreindex -lt 1 ]
        	then exit 0
        fi
    done

