duke@435: #!/bin/sh duke@435: # duke@435: # Copyright 2002 Sun Microsystems, Inc. All Rights Reserved. duke@435: # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. duke@435: # duke@435: # This code is free software; you can redistribute it and/or modify it duke@435: # under the terms of the GNU General Public License version 2 only, as duke@435: # published by the Free Software Foundation. duke@435: # duke@435: # This code is distributed in the hope that it will be useful, but WITHOUT duke@435: # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or duke@435: # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License duke@435: # version 2 for more details (a copy is included in the LICENSE file that duke@435: # accompanied this code). duke@435: # duke@435: # You should have received a copy of the GNU General Public License version duke@435: # 2 along with this work; if not, write to the Free Software Foundation, duke@435: # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. duke@435: # duke@435: # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, duke@435: # CA 95054 USA or visit www.sun.com if you need additional information or duke@435: # have any questions. duke@435: # duke@435: # duke@435: duke@435: # jdb is a .c file that seems to discard the setting of CLASSPATH. duke@435: # So, we have to run jdb by calling java directly :-( duke@435: duke@435: # License file for development version of dbx duke@435: LM_LICENSE_FILE=7588@extend.eng:/usr/dist/local/config/sparcworks/license.dat:7588@setlicense duke@435: export LM_LICENSE_FILE duke@435: duke@435: doUsage() duke@435: { duke@435: cat < /dev/null duke@435: if [ $? = 0 ] ; then duke@435: # it is a pid duke@435: args="$args $1" duke@435: echo "Error: A pid is not yet allowed" duke@435: exit 1 duke@435: else duke@435: # It is a core. duke@435: # We have to pass the name of the program that produced the duke@435: # core, and the core file itself. duke@435: args="$1" duke@435: fi duke@435: ;; duke@435: esac duke@435: shift duke@435: done duke@435: duke@435: if [ -z "$jdk" ] ; then duke@435: echo "Error: -jdk jdk-pathname is required" duke@435: exit 1 duke@435: fi duke@435: if [ -z "$sa" ] ; then duke@435: echo "Error: -sa sa-pathname is required" duke@435: exit 1 duke@435: fi duke@435: duke@435: if [ -z "$args" ] ; then duke@435: echo "Error: a core file or pid must be specified" duke@435: exit 1 duke@435: fi duke@435: duke@435: set -x duke@435: $jdk/bin/jdb -J-Xbootclasspath/a:$sa -connect \ duke@435: sun.jvm.hotspot.jdi.SACoreAttachingConnector:core=$args,javaExecutable=$jdk/bin/java duke@435: duke@435: duke@435: #$jdk/bin/java -Xbootclasspath/a:$mmm/ws/merlin-sa/build/agent \ duke@435: # com.sun.tools.example.debug.tty.TTY -connect \ duke@435: # sun.jvm.hotspot.jdi.SACoreAttachingConnector:core=sagcore,javaExecutable=$jdk/bin/java