Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/agent/test/jdi/runjdb.sh
38764 views
#!/bin/sh1#2# Copyright (c) 2002, 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# jdb is a .c file that seems to discard the setting of CLASSPATH.26# So, we have to run jdb by calling java directly :-(2728# License file for development version of dbx29LM_LICENSE_FILE=7588@extend.eng:/usr/dist/local/config/sparcworks/license.dat:7588@setlicense30export LM_LICENSE_FILE3132doUsage()33{34cat <<EOF35Usage: runjdb.sh corefile -jdk jdk-pathname -sa sa-pathname36sa-pathname is the path of a JDI-SA build dir.37EOF38}3940jdk=41javaArgs=42args=43sa=44while [ $# != 0 ] ; do45case $1 in46-vv)47set -x48;;49-jdk)50jdk=$251shift52;;53-sa)54sa=$255shift56;;57-help | help)58doUsage59exit60;;61-*)62javaArgs="$javaArgs $1"63;;64*)65if [ ! -z "$args" ] ; then66echo "Error: Only one core file or pid can be specified"67exit 168fi69echo "$1" | grep -s '^[0-9]*$' > /dev/null70if [ $? = 0 ] ; then71# it is a pid72args="$args $1"73echo "Error: A pid is not yet allowed"74exit 175else76# It is a core.77# We have to pass the name of the program that produced the78# core, and the core file itself.79args="$1"80fi81;;82esac83shift84done8586if [ -z "$jdk" ] ; then87echo "Error: -jdk jdk-pathname is required"88exit 189fi90if [ -z "$sa" ] ; then91echo "Error: -sa sa-pathname is required"92exit 193fi9495if [ -z "$args" ] ; then96echo "Error: a core file or pid must be specified"97exit 198fi99100set -x101$jdk/bin/jdb -J-Xbootclasspath/a:$sa -connect \102sun.jvm.hotspot.jdi.SACoreAttachingConnector:core=$args,javaExecutable=$jdk/bin/java103104105#$jdk/bin/java -Xbootclasspath/a:$mmm/ws/merlin-sa/build/agent \106# com.sun.tools.example.debug.tty.TTY -connect \107# sun.jvm.hotspot.jdi.SACoreAttachingConnector:core=sagcore,javaExecutable=$jdk/bin/java108109110