#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
#
# @test Solaris32AndSolaris64Test.sh
# @bug 4478312 4780570 4913748 6730273
# @summary Test debugging with mixed 32/64bit VMs.
# @author Tim Bell
# Based on test/java/awt/TEMPLATE/AutomaticShellTest.sh
#
# @run build TestScaffold VMConnection TargetListener TargetAdapter
# @run compile -g FetchLocals.java
# @run compile -g DataModelTest.java
# @run shell/timeout=240 Solaris32AndSolaris64Test.sh DataModelTest
# @run shell/timeout=240 Solaris32AndSolaris64Test.sh FetchLocals
# Beginning of subroutines:
status=1
#Call this from anywhere to fail the test with an error message
# usage: fail "reason why the test failed"
{ echo "The test failed :-("
echo "$*" 1>&2
echo "exit status was $status"
exit $status
} #end of fail()
#Call this from anywhere to pass the test with a message
# usage: pass "reason why the test passed if applicable"
{ echo "The test passed!!!"
echo "$*" 1>&2
exit 0
} #end of pass()
# end of subroutines
if [ $# = 0 ] ; then
echo "Error: no testname specified on cmd line"
exit 1
fi
testName=$1
shift
#Set appropriate jdk
if [ -z "${TESTJAVA}" ] ; then
# TESTJAVA is not set, so the test is running stand-alone.
# TESTJAVA holds the path to the root directory of the build of the JDK
# to be tested. That is, any java files run explicitly in this shell
# should use TESTJAVA in the path to the java interpreter.
# So, we'll set this to the JDK spec'd on the command line. If none
# is given on the command line, tell the user that and use a default.
# THIS IS THE JDK BEING TESTED.
if [ -n "$1" ] ; then
TESTJAVA=$1
else
echo "no JDK specified on command line so using JAVA_HOME=$JAVA_HOME"
fi
TESTSRC=.
STANDALONE=1;
fi
echo "JDK under test is: $TESTJAVA"
# The beginning of the script proper
# Checking for proper OS and processor type.
#
# This test is only interested in SunOS SPARC sparcv9 and SunOS AMD64
# (supporting both 32 and 64 bit Solaris binaries).
#
# All other platforms will instantly complete with passing
# status.
#
SunOS )
PATHSEP=":"
# Instruction set being used by the OS
else
#SunOS 5.6 didn't have "isainfo"
fi
;;
;;
;;
# catch all other OSs
* )
echo "Unrecognized system! $OS"
;;
esac
# Is the OS running in sparcv9 or amd64 mode?
case "${ISET}" in
sparc )
;;
i386 )
;;
amd64 )
echo "OS is running in ${ISET} mode"
;;
sparcv9 )
echo "OS is running in ${ISET} mode"
;;
# catch all others
* )
;;
esac
# SunOS 32 and 64 bit binaries must be available
# to test in the remainder of the script below.
if [ $? = 1 ]; then
# The 64 bit version is not installed. Make the test pass.
fi
# Want this test to run standalone as well as in the harness, so do the
# following to copy the test's directory into the harness's scratch directory
# and set all appropriate variables:
#Deal with .class files:
if [ -n "${STANDALONE}" ] ; then
#if running standalone, compile the support files
fi
# Get DEBUGGEE flags
if [ ! -r ${filename} ] ; then
fi
# Remove -d32, -d64 if present, and remove -XX:[+-]UseCompressedOops
# if present since it is illegal in 32 bit mode.
if [ -r ${filename} ] ; then
DEBUGGEEFLAGS=`cat ${filename} | sed \
-e 's/-d32//g' \
-e 's/-d64//g' \
-e 's/-XX:.UseCompressedOops//g' \
`
fi
#
export CLASSPATH
CP="-classpath \"${CLASSPATH}\""
for DEBUGGERMODEL in \
32 \
64 \
; do
for TARGETMODEL in \
32 \
64 \
; do
DEBUGGERFLAGS="-d${DEBUGGERMODEL} -showversion -DEXPECTED=${TARGETMODEL}"
CONNECTSTRING="-connect 'com.sun.jdi.CommandLineLaunch:options=-d${TARGETMODEL} $DEBUGGEEFLAGS -showversion'"
echo "--------------------------------------------"
echo "debugger=${DEBUGGERMODEL} debugee=${TARGETMODEL} class=${TARGETCLASS}"
echo "--------------------------------------------"
status=$?
then fail "$DEBUGGERMODEL to $TARGETMODEL test failed for class=$TARGETCLASS!"
fi
done
done
done
#
# pass or fail the test based on status of the command
then pass ""
else fail "unspecified test failure"
fi