allow to debug sa-jdwp process

This commit is contained in:
Egor Ushakov
2018-11-22 13:24:47 +03:00
parent 644c1b834f
commit cb884a58fd
2 changed files with 7 additions and 1 deletions
@@ -10,6 +10,7 @@ import com.intellij.execution.process.ProcessOutput;
import com.intellij.execution.util.ExecUtil;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.util.Key;
import com.intellij.openapi.util.registry.Registry;
import com.sun.jdi.VirtualMachine;
import com.sun.jdi.connect.Connector;
import com.sun.jdi.connect.IllegalConnectorArgumentsException;
@@ -56,7 +57,11 @@ public class SAJDWPRemoteConnection extends PidRemoteConnection {
@Override
public VirtualMachine accept(Map<String, ? extends Argument> map) throws IOException, IllegalConnectorArgumentsException {
try {
startServer(new GeneralCommandLine(myCommands), false);
GeneralCommandLine commandLine = new GeneralCommandLine(myCommands);
if (Registry.is("debugger.sa.jdwp.debug")) {
commandLine.getParametersList().replaceOrPrepend("-agentlib:jdwp", "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n");
}
startServer(commandLine, false);
} catch (IOException e) {
throw e;
} catch (Exception e) {
@@ -439,6 +439,7 @@ debugger.variablesView.rss.description=Enable node expanding in variables view s
debugger.variablesView.rss.depth=4
debugger.variablesView.rss.depth.description=Depth of search in variables view
debugger.attach.to.process.action=true
debugger.sa.jdwp.debug=false
execution.java.always.debug=false
execution.java.always.debug.description=Always run java processes with the debug agent