mirror of
https://github.com/openjdk/jdk.git
synced 2026-05-14 07:29:51 +00:00
8359958: Cleanup "local" debuggee references after JDK-8333117 removed support for non-local debuggees
Reviewed-by: lmesnik, sspitsyn, amenkov
This commit is contained in:
parent
05c9eec8d0
commit
39c9de2ace
@ -1,6 +1,6 @@
|
||||
|
||||
/*
|
||||
* Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2019, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -65,7 +65,7 @@ public class TestProcessLauncher {
|
||||
|
||||
String cmd = prepareLaunch(java, argHandler.getPipePort());
|
||||
|
||||
Debugee debuggee = binder.startLocalDebugee(cmd);
|
||||
Debugee debuggee = binder.startDebugee(cmd);
|
||||
debuggee.redirectOutput(log);
|
||||
|
||||
String line = pipe.readln();
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -105,7 +105,7 @@ public class attach001 {
|
||||
|
||||
Binder binder = new Binder(argHandler, log);
|
||||
log.display("command: " + cmd);
|
||||
Debugee debugee = binder.startLocalDebugee(cmd);
|
||||
Debugee debugee = binder.startDebugee(cmd);
|
||||
JDWP.ListenAddress listenAddress = debugee.redirectOutputAndDetectListeningAddress(log);
|
||||
String port = listenAddress.address();
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -110,7 +110,7 @@ public class attach002 extends Log {
|
||||
|
||||
Binder binder = new Binder(argHandler, log);
|
||||
log.display("command: " + cmd);
|
||||
Debugee debugee = binder.startLocalDebugee(cmd);
|
||||
Debugee debugee = binder.startDebugee(cmd);
|
||||
debugee.redirectOutput(log);
|
||||
|
||||
if ((vm = attachTarget(name)) == null) {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2007, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2007, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -105,7 +105,7 @@ public class attachnosuspend001 {
|
||||
|
||||
Binder binder = new Binder(argHandler, log);
|
||||
log.display("command: " + cmd);
|
||||
Debugee debugee = binder.startLocalDebugee(cmd);
|
||||
Debugee debugee = binder.startDebugee(cmd);
|
||||
JDWP.ListenAddress listenAddress = debugee.redirectOutputAndDetectListeningAddress(log);
|
||||
String port = listenAddress.address();
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2007, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2007, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -116,7 +116,7 @@ public class launchnosuspend001 {
|
||||
|
||||
//vm.setDebugTraceMode(VirtualMachine.TRACE_ALL);
|
||||
Binder binder = new Binder(argHandler, log);
|
||||
Debugee debugee = binder.makeLocalDebugee(vm.process());
|
||||
Debugee debugee = binder.makeDebugee(vm.process());
|
||||
debugee.redirectOutput(log);
|
||||
debugee.setupVM(vm);
|
||||
//debugee.waitForVMInit(1000);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -89,7 +89,7 @@ public class accept001 {
|
||||
|
||||
Binder binder = new Binder(argHandler, log);
|
||||
log.display("command: " + cmd);
|
||||
Debugee debugee = binder.startLocalDebugee(cmd);
|
||||
Debugee debugee = binder.startDebugee(cmd);
|
||||
debugee.redirectOutput(log);
|
||||
|
||||
if ((vm = attachTarget()) == null) {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -90,7 +90,7 @@ public class accept002 {
|
||||
|
||||
Binder binder = new Binder(argHandler, log);
|
||||
log.display("command: " + cmd);
|
||||
Debugee debugee = binder.startLocalDebugee(cmd);
|
||||
Debugee debugee = binder.startDebugee(cmd);
|
||||
debugee.redirectOutput(log);
|
||||
|
||||
if ((vm = attachTarget()) == null) {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2007, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2007, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -89,7 +89,7 @@ public class listennosuspend001 {
|
||||
|
||||
Binder binder = new Binder(argHandler, log);
|
||||
log.display("command: " + cmd);
|
||||
Debugee debugee = binder.startLocalDebugee(cmd);
|
||||
Debugee debugee = binder.startDebugee(cmd);
|
||||
debugee.redirectOutput(log);
|
||||
|
||||
if ((vm = attachTarget()) == null) {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -168,7 +168,7 @@ public class startlis001 {
|
||||
|
||||
log.display("command: " + cmd);
|
||||
try {
|
||||
debugee = binder.startLocalDebugee(cmd);
|
||||
debugee = binder.startDebugee(cmd);
|
||||
debugee.redirectOutput(log);
|
||||
} catch (Exception e) {
|
||||
stopListen();
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -143,7 +143,7 @@ public class startlis002 {
|
||||
|
||||
log.display("command: " + cmd);
|
||||
try {
|
||||
debugee = binder.startLocalDebugee(cmd);
|
||||
debugee = binder.startDebugee(cmd);
|
||||
debugee.redirectOutput(log);
|
||||
} catch (Exception e) {
|
||||
stopListen();
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -150,7 +150,7 @@ public class createVM002 {
|
||||
logOnVerbose(infoLogPrefixHead + "PROCESS is being created:");
|
||||
logOnVerbose(infoLogPrefix + "Command to run: " + commandToRun);
|
||||
|
||||
debugee = binder.startLocalDebugee(commandToRun);
|
||||
debugee = binder.startDebugee(commandToRun);
|
||||
debugee.redirectOutput(logHandler);
|
||||
processToRun = debugee.getProcess();
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -151,7 +151,7 @@ public class createVM003 {
|
||||
logOnVerbose(infoLogPrefixHead + "PROCESS is being created:");
|
||||
logOnVerbose(infoLogPrefix + "Command to run: " + commandToRun);
|
||||
|
||||
debugee = binder.startLocalDebugee(commandToRun);
|
||||
debugee = binder.startDebugee(commandToRun);
|
||||
debugee.redirectOutput(logHandler);
|
||||
processToRun = debugee.getProcess();
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -154,7 +154,7 @@ public class createVM004 {
|
||||
logOnVerbose(infoLogPrefixHead + "PROCESS is being created:");
|
||||
logOnVerbose(infoLogPrefix + "Command to run: " + commandToRun);
|
||||
|
||||
debugee = binder.startLocalDebugee(commandToRun);
|
||||
debugee = binder.startDebugee(commandToRun);
|
||||
debugee.redirectOutput(logHandler);
|
||||
processToRun = debugee.getProcess();
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -150,7 +150,7 @@ public class createVM005 {
|
||||
logOnVerbose(infoLogPrefixHead + "PROCESS is being created:");
|
||||
logOnVerbose(infoLogPrefix + "Command to run: " + commandToRun);
|
||||
|
||||
debugee = binder.startLocalDebugee(commandToRun);
|
||||
debugee = binder.startDebugee(commandToRun);
|
||||
debugee.redirectOutput(logHandler);
|
||||
processToRun = debugee.getProcess();
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2002, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -56,10 +56,10 @@ public class Debuggee extends LocalProcess {
|
||||
}
|
||||
|
||||
/**
|
||||
* Launch debuggee on local host.
|
||||
* Launch debuggee.
|
||||
*/
|
||||
public void launch(String[] args) throws IOException {
|
||||
launcher.display("Starting local debuggee.");
|
||||
launcher.display("Starting debuggee.");
|
||||
|
||||
super.launch(args);
|
||||
redirectStdout(launcher.getLog(), DEBUGEE_STDOUT_LOG_PREFIX );
|
||||
|
||||
@ -31,8 +31,8 @@ import java.io.*;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* This class provides launching of <code>jdb</code> and debuggee in local
|
||||
* mode according to test command line options.
|
||||
* This class provides launching of <code>jdb</code> and debuggee
|
||||
* according to test command line options.
|
||||
*/
|
||||
|
||||
public class Launcher extends DebugeeBinder {
|
||||
@ -94,27 +94,27 @@ public class Launcher extends DebugeeBinder {
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines mode (local) and type of connector (default, launching,
|
||||
* Defines type of connector (default, launching,
|
||||
* raw launching, attaching or listening) according to options
|
||||
* parsed by <code>JdbArgumentHandler</code>. And then launches <code>jdb</code>
|
||||
* and debuggee in defined mode.
|
||||
* and debuggee.
|
||||
*/
|
||||
public void launchJdbAndDebuggee (String classToExecute) throws IOException {
|
||||
|
||||
String[] jdbCmdArgs = makeJdbCmdLine(classToExecute);
|
||||
|
||||
if (argumentHandler.isDefaultConnector()) {
|
||||
localDefaultLaunch(jdbCmdArgs, classToExecute);
|
||||
defaultLaunch(jdbCmdArgs, classToExecute);
|
||||
} else if (argumentHandler.isRawLaunchingConnector()) {
|
||||
localRawLaunch(jdbCmdArgs, classToExecute);
|
||||
rawLaunch(jdbCmdArgs, classToExecute);
|
||||
} else if (argumentHandler.isLaunchingConnector()) {
|
||||
localLaunch(jdbCmdArgs, classToExecute);
|
||||
launchFromJdb(jdbCmdArgs, classToExecute);
|
||||
} else if (argumentHandler.isAttachingConnector()) {
|
||||
localLaunchAndAttach(jdbCmdArgs, classToExecute);
|
||||
launchAndAttach(jdbCmdArgs, classToExecute);
|
||||
} else if (argumentHandler.isListeningConnector()) {
|
||||
localLaunchAndListen(jdbCmdArgs, classToExecute);
|
||||
launchAndListen(jdbCmdArgs, classToExecute);
|
||||
} else {
|
||||
throw new TestBug("Unexpected connector type for local launch mode"
|
||||
throw new TestBug("Unexpected connector type: "
|
||||
+ argumentHandler.getConnectorType());
|
||||
}
|
||||
|
||||
@ -255,29 +255,29 @@ public class Launcher extends DebugeeBinder {
|
||||
// ---------------------------------------------- //
|
||||
|
||||
/**
|
||||
* Run test in local mode using default connector.
|
||||
* Run test using default connector.
|
||||
*/
|
||||
private void localDefaultLaunch
|
||||
private void defaultLaunch
|
||||
(String[] jdbCmdArgs, String classToExecute) throws IOException {
|
||||
localLaunch(jdbCmdArgs, classToExecute);
|
||||
launchFromJdb(jdbCmdArgs, classToExecute);
|
||||
}
|
||||
|
||||
/**
|
||||
* Run test in local mode using raw launching connector.
|
||||
* Run test using raw launching connector.
|
||||
*/
|
||||
private void localRawLaunch
|
||||
private void rawLaunch
|
||||
(String[] jdbCmdArgs, String classToExecute) throws IOException {
|
||||
localLaunch(jdbCmdArgs, classToExecute);
|
||||
launchFromJdb(jdbCmdArgs, classToExecute);
|
||||
}
|
||||
|
||||
/**
|
||||
* Run test in local mode using launching connector.
|
||||
* Run test using launching connector.
|
||||
*/
|
||||
private void localLaunch
|
||||
private void launchFromJdb
|
||||
(String[] jdbCmdArgs, String classToExecute) throws IOException {
|
||||
|
||||
jdb = new Jdb(this);
|
||||
display("Starting jdb launching local debuggee");
|
||||
display("Starting jdb launching debuggee");
|
||||
jdb.launch(jdbCmdArgs);
|
||||
|
||||
if (classToExecute != null)
|
||||
@ -287,9 +287,9 @@ public class Launcher extends DebugeeBinder {
|
||||
}
|
||||
|
||||
/**
|
||||
* Run test in local mode using attaching connector.
|
||||
* Run test using attaching connector.
|
||||
*/
|
||||
private void localLaunchAndAttach
|
||||
private void launchAndAttach
|
||||
(String[] jdbCmdArgs, String classToExecute) throws IOException {
|
||||
|
||||
debuggee = new Debuggee(this);
|
||||
@ -297,19 +297,19 @@ public class Launcher extends DebugeeBinder {
|
||||
String[] javaCmdArgs = makeCommandLineArgs(classToExecute, address);
|
||||
debuggee.launch(javaCmdArgs);
|
||||
|
||||
display("Start jdb attaching to local debuggee");
|
||||
display("Starting jdb attaching to debuggee");
|
||||
jdb = Jdb.startAttachingJdb (this, jdbCmdArgs, JDB_STARTED);
|
||||
// jdb.waitForPrompt(0, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Run test in local mode using listening connector.
|
||||
* Run test using listening connector.
|
||||
*/
|
||||
private void localLaunchAndListen
|
||||
private void launchAndListen
|
||||
(String[] jdbCmdArgs, String classToExecute) throws IOException {
|
||||
|
||||
jdb = new Jdb(this);
|
||||
display("Starting jdb listening to local debuggee");
|
||||
display("Starting jdb listening to debuggee");
|
||||
jdb.launch(jdbCmdArgs);
|
||||
String address = jdb.waitForListeningJdb();
|
||||
display("Listening address found: " + address);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2001, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -474,14 +474,6 @@ public class ArgumentHandler extends DebugeeArgumentHandler {
|
||||
+ "jvmdi.strict: non default JVMDI strict mode is not supported now" + getJVMDIStrictMode());
|
||||
}
|
||||
|
||||
/*
|
||||
if (! isLaunchedLocally() && ! isDefaultJVMDIStrictMode()) {
|
||||
throw new BadOption("inconsistent options: "
|
||||
+ "-launch.mode=" + getLaunchMode()
|
||||
+ " and -jvmdi.strict=" + getJVMDIStrictMode());
|
||||
}
|
||||
*/
|
||||
|
||||
super.checkOptions();
|
||||
}
|
||||
}
|
||||
|
||||
@ -123,29 +123,29 @@ public class Binder extends DebugeeBinder {
|
||||
// -------------------------------------------------- //
|
||||
|
||||
/**
|
||||
* Make initial <code>Debugee</code> object for local debuggee process
|
||||
* Make initial <code>Debugee</code> object for debuggee process
|
||||
* started with launching connector.
|
||||
*/
|
||||
public Debugee makeLocalDebugee(Process process) {
|
||||
public Debugee makeDebugee(Process process) {
|
||||
return new Debugee(process, this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Launch local debuggee process with specified command line
|
||||
* Launch debuggee process with specified command line
|
||||
* and make initial <code>Debugee</code> object.
|
||||
*/
|
||||
public Debugee startLocalDebugee(String cmd) {
|
||||
public Debugee startDebugee(String cmd) {
|
||||
Process process = null;
|
||||
|
||||
try {
|
||||
process = launchProcess(cmd);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace(log.getOutStream());
|
||||
throw new Failure("Caught exception while launching local debuggee VM process:\n\t"
|
||||
throw new Failure("Caught exception while launching debuggee VM process:\n\t"
|
||||
+ e);
|
||||
}
|
||||
|
||||
return makeLocalDebugee(process);
|
||||
return makeDebugee(process);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -154,7 +154,7 @@ public class Binder extends DebugeeBinder {
|
||||
* VMStartEvent is received and debuggee is initialized.
|
||||
*/
|
||||
public Debugee enwrapDebugee(VirtualMachine vm, Process proc) {
|
||||
Debugee debugee = makeLocalDebugee(proc);
|
||||
Debugee debugee = makeDebugee(proc);
|
||||
|
||||
display("Redirecting VM output");
|
||||
debugee.redirectOutput(log);
|
||||
@ -189,17 +189,17 @@ public class Binder extends DebugeeBinder {
|
||||
prepareForPipeConnection(argumentHandler);
|
||||
|
||||
if (argumentHandler.isDefaultConnector()) {
|
||||
debugee = localDefaultLaunchDebugee(vmm, classToExecute, classPath);
|
||||
debugee = defaultLaunchDebugee(vmm, classToExecute, classPath);
|
||||
} else if (argumentHandler.isRawLaunchingConnector()) {
|
||||
debugee = localRawLaunchDebugee(vmm, classToExecute, classPath);
|
||||
debugee = rawLaunchDebugee(vmm, classToExecute, classPath);
|
||||
} else if (argumentHandler.isLaunchingConnector()) {
|
||||
debugee = localLaunchDebugee(vmm, classToExecute, classPath);
|
||||
debugee = launchDebugee(vmm, classToExecute, classPath);
|
||||
} else if (argumentHandler.isAttachingConnector()) {
|
||||
debugee = localLaunchAndAttachDebugee(vmm, classToExecute, classPath);
|
||||
debugee = launchAndAttachDebugee(vmm, classToExecute, classPath);
|
||||
} else if (argumentHandler.isListeningConnector()) {
|
||||
debugee = localLaunchAndListenDebugee(vmm, classToExecute, classPath);
|
||||
debugee = launchAndListenDebugee(vmm, classToExecute, classPath);
|
||||
} else {
|
||||
throw new TestBug("Unexpected connector type for local debugee launch mode"
|
||||
throw new TestBug("Unexpected connector type for debugee: "
|
||||
+ argumentHandler.getConnectorType());
|
||||
}
|
||||
|
||||
@ -231,9 +231,9 @@ public class Binder extends DebugeeBinder {
|
||||
// -------------------------------------------------- //
|
||||
|
||||
/**
|
||||
* Launch debugee locally via the default LaunchingConnector.
|
||||
* Launch debugee via the default LaunchingConnector.
|
||||
*/
|
||||
private Debugee localDefaultLaunchDebugee (VirtualMachineManager vmm,
|
||||
private Debugee defaultLaunchDebugee (VirtualMachineManager vmm,
|
||||
String classToExecute,
|
||||
String classPath) {
|
||||
display("Finding connector: " + "default" );
|
||||
@ -257,7 +257,7 @@ public class Binder extends DebugeeBinder {
|
||||
};
|
||||
|
||||
Process process = vm.process();
|
||||
Debugee debugee = makeLocalDebugee(process);
|
||||
Debugee debugee = makeDebugee(process);
|
||||
debugee.redirectOutput(log);
|
||||
debugee.setupVM(vm);
|
||||
|
||||
@ -266,9 +266,9 @@ public class Binder extends DebugeeBinder {
|
||||
|
||||
|
||||
/**
|
||||
* Launch debugee locally via the default LaunchingConnector.
|
||||
* Launch debugee via the default LaunchingConnector.
|
||||
*/
|
||||
private Debugee localLaunchDebugee (VirtualMachineManager vmm,
|
||||
private Debugee launchDebugee (VirtualMachineManager vmm,
|
||||
String classToExecute,
|
||||
String classPath) {
|
||||
|
||||
@ -295,7 +295,7 @@ public class Binder extends DebugeeBinder {
|
||||
};
|
||||
|
||||
Process process = vm.process();
|
||||
Debugee debugee = makeLocalDebugee(process);
|
||||
Debugee debugee = makeDebugee(process);
|
||||
debugee.redirectOutput(log);
|
||||
debugee.setupVM(vm);
|
||||
|
||||
@ -303,9 +303,9 @@ public class Binder extends DebugeeBinder {
|
||||
}
|
||||
|
||||
/**
|
||||
* Launch debugee locally via the RawLaunchingConnector.
|
||||
* Launch debugee via the RawLaunchingConnector.
|
||||
*/
|
||||
private Debugee localRawLaunchDebugee (VirtualMachineManager vmm,
|
||||
private Debugee rawLaunchDebugee (VirtualMachineManager vmm,
|
||||
String classToExecute,
|
||||
String classPath) {
|
||||
display("Finding connector: " + argumentHandler.getConnectorName() );
|
||||
@ -331,7 +331,7 @@ public class Binder extends DebugeeBinder {
|
||||
};
|
||||
|
||||
Process process = vm.process();
|
||||
Debugee debugee = makeLocalDebugee(process);
|
||||
Debugee debugee = makeDebugee(process);
|
||||
debugee.redirectOutput(log);
|
||||
debugee.setupVM(vm);
|
||||
|
||||
@ -339,10 +339,9 @@ public class Binder extends DebugeeBinder {
|
||||
}
|
||||
|
||||
/**
|
||||
* Launch debugee VM locally as a local process and connect to it using
|
||||
* <code>AttachingConnector</code>.
|
||||
* Launch debugee VM and connect to it using <code>AttachingConnector</code>.
|
||||
*/
|
||||
private Debugee localLaunchAndAttachDebugee (VirtualMachineManager vmm,
|
||||
private Debugee launchAndAttachDebugee (VirtualMachineManager vmm,
|
||||
String classToExecute,
|
||||
String classPath) {
|
||||
display("FindingConnector: " + argumentHandler.getConnectorName() );
|
||||
@ -356,7 +355,7 @@ public class Binder extends DebugeeBinder {
|
||||
String javaCmdLine = makeCommandLineString(classToExecute, address, "\"");
|
||||
|
||||
display("Starting java process:\n\t" + javaCmdLine);
|
||||
Debugee debugee = startLocalDebugee(cmdLineArgs);
|
||||
Debugee debugee = startDebugee(cmdLineArgs);
|
||||
debugee.redirectOutput(log);
|
||||
|
||||
display("Attaching to debugee");
|
||||
@ -391,10 +390,9 @@ public class Binder extends DebugeeBinder {
|
||||
}
|
||||
|
||||
/**
|
||||
* Launch debugee VM locally as a local process and connect to it using
|
||||
* <code>ListeningConnector</code>.
|
||||
* Launch debugee VM and connect to it using <code>ListeningConnector</code>.
|
||||
*/
|
||||
private Debugee localLaunchAndListenDebugee (VirtualMachineManager vmm,
|
||||
private Debugee launchAndListenDebugee (VirtualMachineManager vmm,
|
||||
String classToExecute,
|
||||
String classPath) {
|
||||
display("Finding connector: " + argumentHandler.getConnectorName() );
|
||||
@ -419,7 +417,7 @@ public class Binder extends DebugeeBinder {
|
||||
String javaCmdLine = makeCommandLineString(classToExecute, address, "\"");
|
||||
|
||||
display("Starting java process:\n\t" + javaCmdLine);
|
||||
Debugee debugee = startLocalDebugee(cmdLineArgs);
|
||||
Debugee debugee = startDebugee(cmdLineArgs);
|
||||
debugee.redirectOutput(log);
|
||||
|
||||
display("Waiting for connection from debugee");
|
||||
@ -685,21 +683,21 @@ public class Binder extends DebugeeBinder {
|
||||
// -------------------------------------------------- //
|
||||
|
||||
/**
|
||||
* Launch local debuggee process with specified command line arguments
|
||||
* Launch debuggee process with specified command line arguments
|
||||
* and make initial <code>Debugee</code> mirror.
|
||||
*/
|
||||
protected Debugee startLocalDebugee(String[] cmdArgs) {
|
||||
protected Debugee startDebugee(String[] cmdArgs) {
|
||||
Process process = null;
|
||||
|
||||
try {
|
||||
process = launchProcess(cmdArgs);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace(log.getOutStream());
|
||||
throw new Failure("Caught exception while launching local debuggee VM process:\n\t"
|
||||
throw new Failure("Caught exception while launching debuggee VM process:\n\t"
|
||||
+ e);
|
||||
}
|
||||
|
||||
return makeLocalDebugee(process);
|
||||
return makeDebugee(process);
|
||||
}
|
||||
|
||||
public static String readVMStartExceptionOutput(VMStartException e, PrintStream log) {
|
||||
|
||||
@ -38,11 +38,6 @@ import java.util.function.Consumer;
|
||||
* redirect standard output streams, wait for process terminates
|
||||
* or kill the process, and so on.
|
||||
* <p>
|
||||
* This is an abstract class that declares abstract methods to control
|
||||
* debugee VM process.
|
||||
* Derived classes should implement these methods corresponding to the mode
|
||||
* that the process should be started in (locally).
|
||||
* <p>
|
||||
* Particular derived classes <code>nsk.share.jdi.Debugee</code> and
|
||||
* <code>nsk.share.jdwp.Debugee</code> provides additional abilities
|
||||
* to control debugee VM using JDI or JDWP specific features.
|
||||
@ -52,7 +47,7 @@ import java.util.function.Consumer;
|
||||
* @see nsk.share.jdi.Debugee
|
||||
* @see nsk.share.jdwp.Debugee
|
||||
*/
|
||||
abstract public class DebugeeProcess {
|
||||
public class DebugeeProcess {
|
||||
|
||||
/** Default prefix for log messages. */
|
||||
public static final String LOG_PREFIX = "binder> ";
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user