28
votes

I'm using Eclipse to remote debug an application that's in debug client-mode (i.e -Xrunjdwp:transport=dt_socket,address=127.0.0.1:8000 jvm startup parameters, and Eclipse has "socket listen" mode selected in the debugger settings instead of the default "socket attach" mode).

Problem is, once the remote application is started, connects to the Eclipse debugger, and finally exits... the Eclipse debugger stops listening for connections on the specified port.

Just an annoyance, but it'd be nice not to have to keep clicking on the debug button in Eclipse every time I need to debug the application (which needs to be started from outside of Eclipse obviously). Any ideas or tools out there for making this a little more automatic?

2
At your server, u must have opened a port for debugging. for that, you have added, but can u check once, in the server logs, whether the debug is enabled on for that port only, can u also specify what paramter argument you have added in the server config.M.J.
There's no server (this is not a web app), except in the sense that Eclipse's debugger is listening for a connection by a remote application on port 8000. The setting is 'socket attach' mode in the Eclipse remote debug settings. This all works fine, the issue is just that it'd be nice if I didn't have to restart the debugger all the time after the remote app connects and disconnects.Manius
As far as i am concerned, there is no way that your debugger starts automatically.I feel u can achieve it, but u might need to change the eclipse underlying code.M.J.
That's what I'm thinking too. Maybe a plugin could do that, but it's going too far for my needs. ThanksManius
This would be very helpful to me too. Has this been reported as a bug in Eclipse yet?Thorbjørn Ravn Andersen

2 Answers

1
votes

By the nature of the client mode debugging, you will possibly relaunch eclipse in debug mode (listen) manually because you will do the same with the client application (attaching it to the eclipse listening port using jdwp).

But you also can try create a launch configuration programatically using Eclipse SDK, implementing an algorithm to restart the "listen mode" when the vm exists.

1
votes

Just a thought , Can you try using:

-Xrunjdwp:transport=dt_socket,server=y,**suspend=y**

Your application will be suspended till the time the debugger is attached, that way you would atleast be able to debug right from the entry point to your code.