#!/bin/bash THIS_DIR=$(dirname $(readlink -f ${BASH_SOURCE[0]})) RUNTIME_DIR=$(readlink -f $THIS_DIR/../../../Runtime) OS=$(make --quiet -f $THIS_DIR/../../../Pal/src/Makefile.Host print_host) MANIFEST= GDB_CMD= PAL_CMD=$RUNTIME_DIR/pal-$OS if [ "$GDB" == "1" ]; then GDB="gdb" fi if [ "$GDB" != "" ] && [ "$GDB" != "0" ]; then GDB_CMD="$GDB --args" fi if [ "$SEC" == "1" ]; then echo "Use reference monitor" PAL_CMD=$RUNTIME_DIR/pal_sec-$OS fi while [ "$1" != "" ]; do if [ "$MANIFEST" == "" ]; then MANIFEST=$1 shift continue fi break done if [ ! -f "$PAL_CMD" ]; then echo "$PAL_CMD is not built, or security mode is not supported" exit 1 fi set -x exec $GDB_CMD $PAL_CMD $MANIFEST "$@"