123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- #!/bin/bash
- if [ "$1" == "SGX" ]; then
- if [ "$SGX" != "0" ]; then
- export SGX=1
- fi
- shift
- fi
- RUNTIME_DIR=$(/usr/bin/dirname $(readlink -f ${BASH_SOURCE[0]}))
- PAL_HOST=$(/usr/bin/make --quiet -f $RUNTIME_DIR/../Pal/src/Makefile.Host print_host 2>&1)
- MANIFEST=
- PERF_CMD=
- GDB_CMD=
- PAL_CMD=$RUNTIME_DIR/pal-$PAL_HOST
- if [ "$GDB" == "1" ]; then
- GDB=$RUNTIME_DIR/pal_gdb-$PAL_HOST
- if [ ! -f $GDB ]; then
- GDB="/usr/bin/gdb"
- fi
- fi
- if [ "$GDB" != "" ] && [ "$GDB" != "0" ]; then
- GDB_CMD="$GDB --args"
- fi
- if [ "$PERF" == "1" ]; then
- GDB_CMD="perf stat"
- fi
- if [ "$SEC" == "1" ]; then
- echo "Use reference monitor"
- PAL_CMD=$RUNTIME_DIR/pal_sec-$PAL_HOST
- 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
- exec $GDB_CMD $PAL_CMD $MANIFEST "$@"
|