Remote debugging
Hello, I have one question
I am developing plugin for my own server.
Currently i am creating Jar file from the project and deploy it into my server.
And When it comes to debugging I have stucked.
I have extends GenericDebuggerRunner and override doExecute,
Successfully connected to my server
RemoteConnection connection = new RemoteConnection(true, "127.0.0.1", "50473", false);
RunContentDescriptor descriptor = attachVirtualMachine(state,env,connection,false);
So my method now look like:
@Override
protected RunContentDescriptor doExecute(@NotNull Project project, @NotNull RunProfileState state, @Nullable RunContentDescriptor contentToReuse, @NotNull ExecutionEnvironment env) throws ExecutionException {
FileDocumentManager.getInstance().saveAllDocuments();
DeltixDeployParameters parameters = null;
//initConsole(project);
//TODO: This code is for custom console, probably need to wait if it will be required in future.
RemoteConnection connection = new RemoteConnection(true, "127.0.0.1", "50473", false);
RunContentDescriptor descriptor = attachVirtualMachine(state,env,connection,false);
//Some code to deploy jar file
return descriptor;
}
When it runs it should stop on several breakpoints when deployed, but it doesn't.
What I am missing?
Please sign in to leave a comment.
Hi, does it attach at all?
Yes, it is attached.
I have found that I need to do my logic with deploying algorithm after doExecute finished.
Where I can do this?
Please explain it in more details:
- your jar is deployed and you attached to server but debugger does not stop?
or
- you attach before deploying your jar?
Usually jar is deployed already before attaching.
Formally, now it's deploying and then attached.
But I need contra-versa, attach and then deploy.
So I need method that will launch after Debugger is attached.
you can try adding a listener to debug process, find it with the descriptor you get from attachVirtualMachine like:
DebuggerManager.getInstance(env.getProject()).getDebugProcess(descriptor.getProcessHandler())
and then use addDebugProcessListener
Thank you for your reply I will try this.
Found that, I tried to connect in different process to debugger.
So now all working correctly.
Thank you for you help.