If you run a java process with arguments -Xdebug -agentlib:jdwp=transport=dt_socket,suspend=n,server=y,address=9000, the process stops listening on the port once the debugger attaches to it. Then, once the debugger detaches, you can’t connect to it again. Is there any way to attach the debugger once it has been detached? Or is there a jdwp proxy server that is always attached to the process and allows the debugger to attach and detach at will?

有帮助吗?

解决方案

Short answer is yes, you should be able to just reattach. There should be no problems doing this. There might be a race condition if multiple applications try to bind to the same port during detach/attach, but I don't see any other possible issues.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top