make/hotspot.script

Tue, 29 Jul 2014 13:56:29 +0200

author
thartmann
date
Tue, 29 Jul 2014 13:56:29 +0200
changeset 7002
a073be2ce5c2
parent 6198
55fb97c4c58d
child 6876
710a3c8b516e
permissions
-rw-r--r--

8049043: Load variable through a pointer of an incompatible type in hotspot/src/share/vm/runtime/sharedRuntimeMath.hpp
Summary: Fixed parfait warnings caused by __HI and __LO macros in sharedRuntimeMath.hpp by using a union.
Reviewed-by: kvn

never@3156 1 #!/bin/sh
sla@2327 2
mikael@6198 3 # Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
sla@2327 4 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
sla@2327 5 #
sla@2327 6 # This code is free software; you can redistribute it and/or modify it
sla@2327 7 # under the terms of the GNU General Public License version 2 only, as
sla@2327 8 # published by the Free Software Foundation.
sla@2327 9 #
sla@2327 10 # This code is distributed in the hope that it will be useful, but WITHOUT
sla@2327 11 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
sla@2327 12 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
sla@2327 13 # version 2 for more details (a copy is included in the LICENSE file that
sla@2327 14 # accompanied this code).
sla@2327 15 #
sla@2327 16 # You should have received a copy of the GNU General Public License version
sla@2327 17 # 2 along with this work; if not, write to the Free Software Foundation,
sla@2327 18 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
sla@2327 19 #
sla@2327 20 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
sla@2327 21 # or visit www.oracle.com if you need additional information or have any
sla@2327 22 # questions.
sla@2327 23
sla@2327 24
sla@2327 25 # This script launches HotSpot.
sla@2327 26 #
sla@2327 27 # If the first parameter is either "-gdb" or "-gud", HotSpot will be
sla@2327 28 # launched inside gdb. "-gud" means "open an Emacs window and run gdb
sla@2327 29 # inside Emacs".
sla@2327 30 #
sla@2327 31 # If the first parameter is "-dbx", HotSpot will be launched inside dbx.
sla@4013 32 #
sla@2327 33 # If the first parameter is "-valgrind", HotSpot will be launched
sla@2327 34 # inside Valgrind (http://valgrind.kde.org) using the Memcheck skin,
sla@2327 35 # and with memory leak detection enabled. This currently (2005jan19)
sla@2327 36 # requires at least Valgrind 2.3.0. -Xmx16m will also be passed as
sla@2327 37 # the first parameter to HotSpot, since lowering HotSpot's memory
sla@2327 38 # consumption makes execution inside of Valgrind *a lot* faster.
sla@2327 39 #
sla@2327 40
sla@2327 41
sla@2327 42 #
sla@2327 43 # User changeable parameters ------------------------------------------------
sla@2327 44 #
sla@2327 45
sla@2327 46 # This is the name of the gdb binary to use
sla@2327 47 if [ ! "$GDB" ]
sla@4013 48 then
sla@2327 49 GDB=gdb
sla@2327 50 fi
sla@2327 51
sla@2327 52 # This is the name of the gdb binary to use
sla@2327 53 if [ ! "$DBX" ]
sla@4013 54 then
sla@2327 55 DBX=dbx
sla@2327 56 fi
sla@2327 57
sla@2327 58 # This is the name of the Valgrind binary to use
sla@2327 59 if [ ! "$VALGRIND" ]
sla@4013 60 then
sla@2327 61 VALGRIND=valgrind
sla@2327 62 fi
sla@2327 63
sla@2327 64 # This is the name of Emacs for running GUD
sla@2327 65 EMACS=emacs
sla@2327 66
sla@2327 67 #
sla@2327 68 # End of user changeable parameters -----------------------------------------
sla@2327 69 #
sla@2327 70
sla@2327 71 # Make sure the paths are fully specified, i.e. they must begin with /.
brutisso@3187 72 REL_MYDIR=`dirname $0`
brutisso@3187 73 MYDIR=`cd $REL_MYDIR && pwd`
sla@2327 74
twisti@5109 75 #
sla@2327 76 # Look whether the user wants to run inside gdb
sla@2327 77 case "$1" in
sla@2327 78 -gdb)
sla@2327 79 MODE=gdb
sla@2327 80 shift
sla@2327 81 ;;
sla@2327 82 -gud)
sla@2327 83 MODE=gud
sla@2327 84 shift
sla@2327 85 ;;
sla@2327 86 -dbx)
sla@2327 87 MODE=dbx
sla@2327 88 shift
sla@2327 89 ;;
sla@2327 90 -valgrind)
sla@2327 91 MODE=valgrind
sla@2327 92 shift
sla@2327 93 ;;
sla@2327 94 *)
sla@2327 95 MODE=run
sla@2327 96 ;;
sla@2327 97 esac
sla@2327 98
twisti@5109 99 if [ "${ALT_JAVA_HOME}" != "" ]; then
twisti@5109 100 JDK=${ALT_JAVA_HOME%%/jre}
sla@4013 101 else
twisti@5109 102 JDK=@@JDK_IMPORT_PATH@@
sla@2327 103 fi
sla@2327 104
sla@2369 105 if [ "${JDK}" = "" ]; then
twisti@5109 106 echo "Failed to find JDK. Either ALT_JAVA_HOME is not set or JDK_IMPORT_PATH is empty."
sla@2369 107 fi
sla@2369 108
sla@2327 109 # We will set the LD_LIBRARY_PATH as follows:
sla@2327 110 # o $JVMPATH (directory portion only)
sla@2327 111 # o $JRE/lib/$ARCH
sla@2327 112 # followed by the user's previous effective LD_LIBRARY_PATH, if
sla@2327 113 # any.
sla@2327 114 JRE=$JDK/jre
sla@2327 115 JAVA_HOME=$JDK
sla@4013 116 export JAVA_HOME
sla@4013 117
sla@2327 118 ARCH=@@LIBARCH@@
sla@2327 119 SBP=${MYDIR}:${JRE}/lib/${ARCH}
sla@2327 120
sla@2327 121
sla@4013 122 # Set up a suitable LD_LIBRARY_PATH or DYLD_LIBRARY_PATH
sla@4013 123 OS=`uname -s`
sla@4013 124 if [ "${OS}" = "Darwin" ]
sla@2327 125 then
sla@4013 126 if [ -z "$DYLD_LIBRARY_PATH" ]
sla@4013 127 then
sla@4013 128 DYLD_LIBRARY_PATH="$SBP"
sla@4013 129 else
sla@4013 130 DYLD_LIBRARY_PATH="$SBP:$DYLD_LIBRARY_PATH"
sla@4013 131 fi
sla@4013 132 export DYLD_LIBRARY_PATH
sla@2327 133 else
sla@4013 134 # not 'Darwin'
sla@4013 135 if [ -z "$LD_LIBRARY_PATH" ]
sla@4013 136 then
sla@4013 137 LD_LIBRARY_PATH="$SBP"
sla@4013 138 else
sla@4013 139 LD_LIBRARY_PATH="$SBP:$LD_LIBRARY_PATH"
sla@4013 140 fi
sla@4013 141 export LD_LIBRARY_PATH
sla@2327 142 fi
sla@2327 143
twisti@5109 144 JPARMS="-Dsun.java.launcher=gamma -XXaltjvm=$MYDIR $@ $JAVA_ARGS";
sla@2327 145
twisti@5109 146 # Locate the java launcher
twisti@5109 147 LAUNCHER=$JDK/bin/java
sla@2327 148 if [ ! -x $LAUNCHER ] ; then
twisti@5109 149 echo Error: Cannot find the java launcher \"$LAUNCHER\"
sla@2327 150 exit 1
sla@2327 151 fi
sla@2327 152
sla@2327 153 GDBSRCDIR=$MYDIR
brutisso@3187 154 BASEDIR=`cd $MYDIR/../../.. && pwd`
sla@2327 155
sla@2327 156 init_gdb() {
sla@2327 157 # Create a gdb script in case we should run inside gdb
sla@2327 158 GDBSCR=/tmp/hsl.$$
sla@2327 159 rm -f $GDBSCR
sla@2327 160 cat >>$GDBSCR <<EOF
sla@2327 161 cd `pwd`
sla@2327 162 handle SIGUSR1 nostop noprint
sla@2327 163 handle SIGUSR2 nostop noprint
sla@2327 164 set args $JPARMS
sla@2327 165 file $LAUNCHER
sla@2327 166 directory $GDBSRCDIR
sla@2327 167 # Get us to a point where we can set breakpoints in libjvm.so
twisti@5109 168 set breakpoint pending on
twisti@5109 169 break JNI_CreateJavaVM
sla@2327 170 run
twisti@5109 171 # Stop in JNI_CreateJavaVM
sla@2327 172 delete 1
sla@2327 173 # We can now set breakpoints wherever we like
sla@2327 174 EOF
sla@2327 175 }
sla@2327 176
sla@2327 177
sla@2327 178 case "$MODE" in
sla@2327 179 gdb)
sla@2327 180 init_gdb
sla@2327 181 $GDB -x $GDBSCR
sla@2327 182 rm -f $GDBSCR
sla@2327 183 ;;
sla@2327 184 gud)
sla@2327 185 init_gdb
sla@2327 186 # First find out what emacs version we're using, so that we can
sla@2327 187 # use the new pretty GDB mode if emacs -version >= 22.1
brutisso@3187 188 case `$EMACS -version 2> /dev/null` in
sla@2327 189 *GNU\ Emacs\ 2[23]*)
sla@2327 190 emacs_gud_cmd="gdba"
sla@2327 191 emacs_gud_args="--annotate=3"
sla@2327 192 ;;
sla@2327 193 *)
sla@2327 194 emacs_gud_cmd="gdb"
sla@2327 195 emacs_gud_args=
sla@2327 196 ;;
sla@2327 197 esac
sla@2327 198 $EMACS --eval "($emacs_gud_cmd \"$GDB $emacs_gud_args -x $GDBSCR\")";
sla@2327 199 rm -f $GDBSCR
sla@2327 200 ;;
sla@2327 201 dbx)
twisti@5109 202 $DBX -s $HOME/.dbxrc -c "loadobject -load libjvm.so; stop in JNI_CreateJavaVM; run $JPARMS; delete all" $LAUNCHER
sla@2327 203 ;;
sla@2327 204 valgrind)
sla@2327 205 echo Warning: Defaulting to 16Mb heap to make Valgrind run faster, use -Xmx for larger heap
sla@2327 206 echo
sla@2327 207 $VALGRIND --tool=memcheck --leak-check=yes --num-callers=50 $LAUNCHER -Xmx16m $JPARMS
sla@2327 208 ;;
sla@2327 209 run)
sla@2327 210 LD_PRELOAD=$PRELOADING exec $LAUNCHER $JPARMS
sla@2327 211 ;;
sla@2327 212 *)
sla@2327 213 echo Error: Internal error, unknown launch mode \"$MODE\"
sla@2327 214 exit 1
sla@2327 215 ;;
sla@2327 216 esac
sla@2327 217 RETVAL=$?
sla@2327 218 exit $RETVAL

mercurial