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?

7 comments
Comment actions Permalink

Hi, does it attach at all?

0
Comment actions Permalink

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?

0
Comment actions Permalink

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.

0
Comment actions Permalink

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.

0
Comment actions Permalink

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

0
Comment actions Permalink

Thank you for your reply I will try this.

0
Comment actions Permalink

Found that, I tried to connect in different process to debugger.
So now all working correctly.

Thank you for you help.

RemoteConnection connection = new RemoteConnection(true, "127.0.0.1", "50473", false);
RunContentDescriptor descriptor = attachVirtualMachine(state,environment,connection,false);
0

Please sign in to leave a comment.