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