Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/agent/test/jdi/sasanity.sh
38764 views
#!/bin/ksh1#2# Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.3# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.4#5# This code is free software; you can redistribute it and/or modify it6# under the terms of the GNU General Public License version 2 only, as7# published by the Free Software Foundation.8#9# This code is distributed in the hope that it will be useful, but WITHOUT10# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or11# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License12# version 2 for more details (a copy is included in the LICENSE file that13# accompanied this code).14#15# You should have received a copy of the GNU General Public License version16# 2 along with this work; if not, write to the Free Software Foundation,17# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.18#19# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA20# or visit www.oracle.com if you need additional information or have any21# questions.22#23#2425# This script is used to run sanity check on vmStructs.26# Each SA class is checked against a given VM. "PASSED" is27# printed if vmStructs are consistent. Else, "FAILED" is28# printed and an exception stack trace follows.2930usage() {31echo "usage: ./sasanity.sh <jdk>"32echo "<jdk> is the 1.5 j2se directory against which you want to run sanity check"33exit 134}3536if [ "$1" == "" ]; then37usage38fi3940if [ "$1" == "-help" ]; then41usage42fi4344jdk=$145shift46OS=`uname`4748javacp=$jdk/lib/sa-jdi.jar:./workdir4950mkdir -p workdir51if [ SASanityChecker.java -nt ./workdir/SASanityChecker.class ] ; then52$jdk/bin/javac -d ./workdir -classpath $javacp SASanityChecker.java53if [ $? != 0 ] ; then54exit 155fi56fi5758if [ sagtarg.java -nt ./workdir/sagtarg.class ]; then59$jdk/bin/javac -g -classpath -d $workdir sagtarg.java60if [ $? != 0 ] ; then61exit 162fi63fi6465tmp=/tmp/sagsetup66rm -f $tmp67$jdk/bin/java $* sagtarg > $tmp &68pid=$!69while [ ! -s $tmp ] ; do70# Kludge alert!71sleep 272done7374$jdk/bin/java -showversion ${OPTIONS} -classpath $javacp $* SASanityChecker $pid75kill -9 $pid767778