#
# 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.
#
#
# This script runs the test program, sagtest.java, with the regular
# JPDA jdi.
# It then starts up the debuggee part of the test, sagtarg.java,
# and calls gcore to create file sagcore for use in running
# the SA JDI client.
set -x
# jdk is a jdk with the vm from the sa workspace
while [ $# != 0 ] ; do
case $1 in
-vv)
set -x
;;
-gui)
;;
-jdk)
jdk=$2
shift
;;
-jdbx)
do=jdbx
;;
-jdb)
do=jdb
;;
exit
;;
-dontkill)
dontkill=true
;;
-d64)
;;
-*)
;;
*)
if [ $? = 0 ] ; then
# it is a pid
else
# It is a core.
# We have to pass the name of the program that produced the
# core, and the core file itself.
fi
;;
esac
shift
done
# First, run the sagtest.java with the regular JPDA jdi
export CLASSPATH
$jdk/bin/javac -g -source 1.5 -classpath $jdk/classes:$jdk/lib/tools.jar:$workdir -J-Xms40m -d $workdir \
if [ $? != 0 ] ; then
exit 1
fi
# Now run create a core file for use in running sa-jdi
pid=$!
while [ ! -s $tmp ] ; do
# Kludge alert!
sleep 2
done
#rm -f $tmp
# force core dump of the debuggee
if [ "$OS" = "Linux" ]; then
# Linux does not have gcore command. Instead, we use 'gdb's
# gcore command. Note that only some versions of gdb support
# gdb command.
echo "gcore" > gdbscript
else
fi
if [ "$dontkill" != "true" ]; then
kill -9 $pid
fi
fi