Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Can't get Eclipse to listen for debugger connections
Can't get Eclipse to listen for debugger connections [message #1723630] Tue, 16 February 2016 16:26 Go to next message
Eclipse UserFriend
I've used Eclipse as a remote debugger many times. I've done this with either local or remote target processes.

I've also successfully connected from a remote debugger to a test eclipse instance launched from another eclipse instance.

What I'm now trying to do is launch a normal eclipse instance so that the remote debugger can connect to it, and step through some code that Eclipse is executing.

When I attempt the connection, it just says "Connection refused".

Just so it's clear, I have instance "debugger" running on my laptop. I have the "target" instance running on a VM on the host. I've had no trouble launching instance "test" from the "target" instance, and connecting "debugger" to "test". I'm now trying to connect "debugger" to "target", instead of "test". I've even used the same port number that worked for "debugger" to "test" (the "test" instance isn't running when I try this).

I'm following the instructions from this: https://wiki.eclipse.org/How_to_report_a_deadlock#Remote_Debug_Connection .

My resulting command line is just this:
<pathtoeclipsedir>/eclipse -showlocation -vmargs "-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000"


When I first ran this, I then tried to connect from the debugger. It said "Connection refused". After some thought I then ran "netstat -a | grep 8000" on the VM. Nothing there. I then ran "ps -augwwwx | grep java", which showed that the "java" command line had the "-Xdebug" parameters that I added.

Here is the command line that "ps -augwwwx" shows (with some paths elided):
<pathtojre>/bin/java -Doomph.update.url=http://download.eclipse.org/oomph/updates/milestone/latest -Doomph.redirection.index.redirection=index:/->http://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/ -Dosgi.requiredJavaVersion=1.8 -Xms256m -Xmx1024m -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000 -jar <pathtoeclipse>//../../../.p2/pool/plugins/org.eclipse.equinox.launcher_1.3.200.v20151021-1308.jar -os linux -ws gtk -arch x86_64 -showsplash -launcher <pathtoeclipse>/eclipse -name Eclipse --launcher.library <pathtoeclipse>//../../../.p2/pool/plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.300.v20151013-1129/eclipse_1612.so -startup <pathtoeclipse>//../../../.p2/pool/plugins/org.eclipse.equinox.launcher_1.3.200.v20151021-1308.jar --launcher.appendVmargs -exitdata 4f8001 -install <pathtoeclipse> -product org.eclipse.epp.package.java.product -showlocation -vm <pathtojre>/bin/java -vmargs -Doomph.update.url=http://download.eclipse.org/oomph/updates/milestone/latest -Doomph.redirection.index.redirection=index:/->http://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/ -Dosgi.requiredJavaVersion=1.8 -Xms256m -Xmx1024m -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000 -jar <pathtoeclipse>//../../../.p2/pool/plugins/org.eclipse.equinox.launcher_1.3.200.v20151021-1308.jar


So this shows that the "-Xdebug" params are on the command line, but Eclipse doesn't appear to be listening on the port.
Re: Can't get Eclipse to listen for debugger connections [message #1723642 is a reply to message #1723630] Tue, 16 February 2016 21:15 Go to previous messageGo to next message
Eclipse UserFriend
No quotes around what you provide to -vmargs. Eclipse's command-line parsing is unintuitive to those from a *nix background. Everything after -vmargs is copied arg for arg to the JVM. You want to run:

eclipse -showlocation -vmargs -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000


(I've never included "-Djava.compiler=none")

You might also want to try using onthrow to have the JVM connect to the debugger when a particular exception is thrown (e.g., "address=8000,onthrow=java.util.zip.ZipException").
Re: Can't get Eclipse to listen for debugger connections [message #1723656 is a reply to message #1723642] Wed, 17 February 2016 01:16 Go to previous messageGo to next message
Eclipse UserFriend
Thanks. That worked. Adding "onthrow" looks useful, although it's essentially sugar. It's easy enough to set an exception breakpoint once the debugger connects. In any case, it hit the breakpoint, although I don't have source for most of the classes in the stacktrace, so I'm going to have to track those down. I have JD-Eclipse installed, but that rarely works anymore.
Re: Can't get Eclipse to listen for debugger connections [message #1723740 is a reply to message #1723656] Wed, 17 February 2016 09:15 Go to previous messageGo to next message
Eclipse UserFriend
It's sugar until that exception occurs before you can do something about it. You may not have all the code to view.

BTW: you'll need to explicitly add the source for your current projects to the Remote Java Application source lookup for it to find the source code, either through the Launch Config's Source tab or via the Edit Source Lookup button on the editors.
Re: Can't get Eclipse to listen for debugger connections [message #1723758 is a reply to message #1723740] Wed, 17 February 2016 11:39 Go to previous message
Eclipse UserFriend
In this case, the exception doesn't occur until I attempt to install the plugin, so clearly I would have time to set breakpoints, but your point is certainly valid in the general case.
Previous Topic:IStartup does not appear to work in Eclipse Mars
Next Topic:Any way to configure an Eclipse test instance so it can install plugins normally?
Goto Forum:
  


Current Time: Mon Mar 24 16:50:02 EDT 2025

Powered by FUDForum. Page generated in 0.05405 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top