src/jdk.jdi/share/classes/com/sun/tools/jdi/SunCommandLineLauncher.java
author erikj
Tue, 12 Sep 2017 19:03:39 +0200
changeset 47216 71c04702a3d5
parent 45714 jdk/src/jdk.jdi/share/classes/com/sun/tools/jdi/SunCommandLineLauncher.java@1820d351198d
permissions -rw-r--r--
8187443: Forest Consolidation: Move files to unified layout Reviewed-by: darcy, ihse
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
45714
1820d351198d 8183012: Code cleanup in com.sun.tools.jdi
clanger
parents: 37782
diff changeset
     2
 * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package com.sun.tools.jdi;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
45714
1820d351198d 8183012: Code cleanup in com.sun.tools.jdi
clanger
parents: 37782
diff changeset
    28
import java.io.File;
1820d351198d 8183012: Code cleanup in com.sun.tools.jdi
clanger
parents: 37782
diff changeset
    29
import java.io.IOException;
1820d351198d 8183012: Code cleanup in com.sun.tools.jdi
clanger
parents: 37782
diff changeset
    30
import java.lang.reflect.InvocationTargetException;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
import java.util.Map;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
import java.util.Random;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
45714
1820d351198d 8183012: Code cleanup in com.sun.tools.jdi
clanger
parents: 37782
diff changeset
    34
import com.sun.jdi.VirtualMachine;
1820d351198d 8183012: Code cleanup in com.sun.tools.jdi
clanger
parents: 37782
diff changeset
    35
import com.sun.jdi.connect.Connector;
1820d351198d 8183012: Code cleanup in com.sun.tools.jdi
clanger
parents: 37782
diff changeset
    36
import com.sun.jdi.connect.IllegalConnectorArgumentsException;
1820d351198d 8183012: Code cleanup in com.sun.tools.jdi
clanger
parents: 37782
diff changeset
    37
import com.sun.jdi.connect.Transport;
1820d351198d 8183012: Code cleanup in com.sun.tools.jdi
clanger
parents: 37782
diff changeset
    38
import com.sun.jdi.connect.VMStartException;
1820d351198d 8183012: Code cleanup in com.sun.tools.jdi
clanger
parents: 37782
diff changeset
    39
import com.sun.jdi.connect.spi.TransportService;
1820d351198d 8183012: Code cleanup in com.sun.tools.jdi
clanger
parents: 37782
diff changeset
    40
1820d351198d 8183012: Code cleanup in com.sun.tools.jdi
clanger
parents: 37782
diff changeset
    41
public class SunCommandLineLauncher extends AbstractLauncher {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
    static private final String ARG_HOME = "home";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
    static private final String ARG_OPTIONS = "options";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
    static private final String ARG_MAIN = "main";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
    static private final String ARG_INIT_SUSPEND = "suspend";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
    static private final String ARG_QUOTE = "quote";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
    static private final String ARG_VM_EXEC = "vmexec";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
    TransportService transportService;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
    Transport transport;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
    boolean usingSharedMemory = false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
    TransportService transportService() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
        return transportService;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
    public Transport transport() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
        return transport;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
    public SunCommandLineLauncher() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
        super();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
         * By default this connector uses either the shared memory
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
         * transport or the socket transport
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
        try {
45714
1820d351198d 8183012: Code cleanup in com.sun.tools.jdi
clanger
parents: 37782
diff changeset
    70
            transportService = (TransportService)Class.
1820d351198d 8183012: Code cleanup in com.sun.tools.jdi
clanger
parents: 37782
diff changeset
    71
                forName("com.sun.tools.jdi.SharedMemoryTransportService").
1820d351198d 8183012: Code cleanup in com.sun.tools.jdi
clanger
parents: 37782
diff changeset
    72
                getDeclaredConstructor().newInstance();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
            transport = new Transport() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
                public String name() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
                    return "dt_shmem";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
            };
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
            usingSharedMemory = true;
37782
ad8fe7507ecc 6850612: Deprecate Class.newInstance since it violates the checked exception language contract
darcy
parents: 25859
diff changeset
    79
        } catch (ClassNotFoundException |
ad8fe7507ecc 6850612: Deprecate Class.newInstance since it violates the checked exception language contract
darcy
parents: 25859
diff changeset
    80
                 UnsatisfiedLinkError |
ad8fe7507ecc 6850612: Deprecate Class.newInstance since it violates the checked exception language contract
darcy
parents: 25859
diff changeset
    81
                 InstantiationException |
45714
1820d351198d 8183012: Code cleanup in com.sun.tools.jdi
clanger
parents: 37782
diff changeset
    82
                 InvocationTargetException |
1820d351198d 8183012: Code cleanup in com.sun.tools.jdi
clanger
parents: 37782
diff changeset
    83
                 IllegalAccessException |
1820d351198d 8183012: Code cleanup in com.sun.tools.jdi
clanger
parents: 37782
diff changeset
    84
                 NoSuchMethodException x) {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
        };
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
        if (transportService == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
            transportService = new SocketTransportService();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
            transport = new Transport() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
                public String name() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
                    return "dt_socket";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
            };
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
        addStringArgument(
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
                ARG_HOME,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
                getString("sun.home.label"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
                getString("sun.home"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
                System.getProperty("java.home"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
                false);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
        addStringArgument(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
                ARG_OPTIONS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
                getString("sun.options.label"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
                getString("sun.options"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
                "",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
                false);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
        addStringArgument(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
                ARG_MAIN,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
                getString("sun.main.label"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
                getString("sun.main"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
                "",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
                true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
        addBooleanArgument(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
                ARG_INIT_SUSPEND,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
                getString("sun.init_suspend.label"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
                getString("sun.init_suspend"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
                true,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
                false);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
        addStringArgument(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
                ARG_QUOTE,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
                getString("sun.quote.label"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
                getString("sun.quote"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
                "\"",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
                true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
        addStringArgument(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
                ARG_VM_EXEC,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
                getString("sun.vm_exec.label"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
                getString("sun.vm_exec"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
                "java",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
                true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
    static boolean hasWhitespace(String string) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
        int length = string.length();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
        for (int i = 0; i < length; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
            if (Character.isWhitespace(string.charAt(i))) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
                return true;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
        return false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
    public VirtualMachine
45714
1820d351198d 8183012: Code cleanup in com.sun.tools.jdi
clanger
parents: 37782
diff changeset
   146
        launch(Map<String, ? extends Connector.Argument> arguments)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
        throws IOException, IllegalConnectorArgumentsException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
               VMStartException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
        VirtualMachine vm;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
        String home = argument(ARG_HOME, arguments).value();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
        String options = argument(ARG_OPTIONS, arguments).value();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
        String mainClassAndArgs = argument(ARG_MAIN, arguments).value();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
        boolean wait = ((BooleanArgumentImpl)argument(ARG_INIT_SUSPEND,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
                                                  arguments)).booleanValue();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
        String quote = argument(ARG_QUOTE, arguments).value();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
        String exe = argument(ARG_VM_EXEC, arguments).value();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
        String exePath = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
        if (quote.length() > 1) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
            throw new IllegalConnectorArgumentsException("Invalid length",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
                                                         ARG_QUOTE);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
        if ((options.indexOf("-Djava.compiler=") != -1) &&
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
            (options.toLowerCase().indexOf("-djava.compiler=none") == -1)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
            throw new IllegalConnectorArgumentsException("Cannot debug with a JIT compiler",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
                                                         ARG_OPTIONS);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
        /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
         * Start listening.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
         * If we're using the shared memory transport then we pick a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
         * random address rather than using the (fixed) default.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
         * Random() uses System.currentTimeMillis() as the seed
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
         * which can be a problem on windows (many calls to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
         * currentTimeMillis can return the same value), so
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
         * we do a few retries if we get an IOException (we
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
         * assume the IOException is the filename is already in use.)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
        TransportService.ListenKey listenKey;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
        if (usingSharedMemory) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
            Random rr = new Random();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
            int failCount = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
            while(true) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
                try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
                    String address = "javadebug" +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
                        String.valueOf(rr.nextInt(100000));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
                    listenKey = transportService().startListening(address);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
                    break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
                } catch (IOException ioe) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
                    if (++failCount > 5) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
                        throw ioe;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
                    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
            listenKey = transportService().startListening();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
        String address = listenKey.address();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
        try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
            if (home.length() > 0) {
20201
50cc2d25a60b 8020552: [launcher] changes to support removal of Solaris 32-bit distribution
ksrini
parents: 17484
diff changeset
   205
                exePath = home + File.separator + "bin" + File.separator + exe;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
            } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
                exePath = exe;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
            // Quote only if necessary in case the quote arg value is bogus
17484
4ad440adc4b1 8014676: Java debugger may fail to run
dmeetry
parents: 14342
diff changeset
   210
            if (hasWhitespace(exePath)) {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
                exePath = quote + exePath + quote;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
            String xrun = "transport=" + transport().name() +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
                          ",address=" + address +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
                          ",suspend=" + (wait? 'y' : 'n');
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
            // Quote only if necessary in case the quote arg value is bogus
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
            if (hasWhitespace(xrun)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
                xrun = quote + xrun + quote;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
            String command = exePath + ' ' +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
                             options + ' ' +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
                             "-Xdebug " +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
                             "-Xrunjdwp:" + xrun + ' ' +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
                             mainClassAndArgs;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
            // System.err.println("Command: \"" + command + '"');
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
            vm = launch(tokenizeCommand(command, quote.charAt(0)), address, listenKey,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
                        transportService());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
        } finally {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
            transportService().stopListening(listenKey);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
        return vm;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
    public String name() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
        return "com.sun.jdi.CommandLineLaunch";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
    public String description() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
        return getString("sun.description");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
}