/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
boolean usingSharedMemory = false;
return transportService;
}
return transport;
}
public SunCommandLineLauncher() {
super();
/**
* By default this connector uses either the shared memory
* transport or the socket transport
*/
try {
return "dt_shmem";
}
};
usingSharedMemory = true;
} catch (ClassNotFoundException x) {
} catch (UnsatisfiedLinkError x) {
} catch (InstantiationException x) {
} catch (IllegalAccessException x) {
};
if (transportService == null) {
transportService = new SocketTransportService();
return "dt_socket";
}
};
}
getString("sun.home.label"),
getString("sun.home"),
false);
getString("sun.options.label"),
getString("sun.options"),
"",
false);
getString("sun.main.label"),
getString("sun.main"),
"",
true);
true,
false);
getString("sun.quote.label"),
getString("sun.quote"),
"\"",
true);
getString("sun.vm_exec.label"),
getString("sun.vm_exec"),
"java",
true);
}
for (int i = 0; i < length; i++) {
return true;
}
}
return false;
}
public VirtualMachine
{
arguments)).booleanValue();
throw new IllegalConnectorArgumentsException("Invalid length",
}
throw new IllegalConnectorArgumentsException("Cannot debug with a JIT compiler",
}
/*
* Start listening.
* If we're using the shared memory transport then we pick a
* random address rather than using the (fixed) default.
* Random() uses System.currentTimeMillis() as the seed
* which can be a problem on windows (many calls to
* currentTimeMillis can return the same value), so
* we do a few retries if we get an IOException (we
* assume the IOException is the filename is already in use.)
*/
if (usingSharedMemory) {
int failCount = 0;
while(true) {
try {
break;
} catch (IOException ioe) {
if (++failCount > 5) {
throw ioe;
}
}
}
} else {
}
try {
/*
* A wrinkle in the environment:
*/
} else {
}
} else {
}
// Quote only if necessary in case the quote arg value is bogus
if (hasWhitespace(exePath)) {
}
",address=" + address +
// Quote only if necessary in case the quote arg value is bogus
if (hasWhitespace(xrun)) {
}
options + ' ' +
"-Xdebug " +
// System.err.println("Command: \"" + command + '"');
transportService());
} finally {
}
return vm;
}
return "com.sun.jdi.CommandLineLaunch";
}
return getString("sun.description");
}
}