Saturday, May 22, 2010

Admirer of Eclipse

Helios is looking for 360 friends I am sure with generous Eclipse community, this won't be hard to get. However, we can do something more.

I am suggesting a smaller donation package named 'Admirer of Eclipse'. For a donation of $15 or $20, the donor will get a batch like Friend of Eclipse and Early access to Helios release.

There are two main reasons I came up with this suggestion.

1. There is much less donation from AP region compared to other geographies. This is probably because $35 when converted to local currency becomes a significant figure. I feel may be $15 or $20 is more affordable.

2. One of the major benefit the 'Friends of Eclipse' enjoy is the faster downloads. Now since most Eclipse users at least here in India (and probably adjoining Geos) have 128 kbps or less internet connection. Hence, the larger bandwidth from Eclipse servers is no more a benefit for them.

Please vote a Yes or a No for the idea below (or if can't see it)

Sunday, May 2, 2010

Remote Debugging Eclipse

Recently I ran into a nasty bug that will get reproduced only in host Eclipse 1.The best way to catch them is by remote debugging.

Remote Debugging
Remote debugging is a java feature. Since Eclipse is java application (running inside a JVM) we can remote debug it given the JVM used to launch Eclipse supports it. Most JVMs supports remote debugging from pre-1.4 era.

WebSphere give a nice definition "Debugging a program running on one system while controlling the program from another system is known as remote debugging. The debugger supports remote debugging by allowing you to run the debugger user interface on one system, while running the debug engine on another system. The system running the debugger user interface is known as the local system. The system where the debug engine runs is known as the remote system."

How to remote debug Eclipse?
  1. Start the Eclipse as server
  2. We need to pass -Xdebug VM argument to Eclipse to tell JVM to get launched with debugger. We need to pass certain more options to tell it to start in server mode and listen to a particular socket.

    This command shall be entered on the command prompt
    eclipse.exe -vmargs -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=1044 


    See the complete details for the options and their meaning at Connection and Invocation Details page.

  3. Creating a Remote Java Application debug config
  4. Start another instance of Eclipse where we will debug the other instance launched in Step 1. Also check out the code that you want to debug. Once this is done, open debug launch configurations and choose 'Remote Java Application' and create a new debug config.

    The project text box shall contain the project which has the code that needs to be debugged. The connection type shall be standard socket attach while port will contain the socket address we gave in Step 1. The host is localhost we both instances are running of same machine.

  5. Connecting and attaching to the remote server
  6. Launch the debug config like any other debug config. This will launch the debug mode. Place the breakpoints and do the relevant actions in the server Eclipse instance to hit the.

  7. Debugging
  8. The debug process is same as normal debug. No differences. However, if you change the code then the updated code is not what that would run. Remember the server Eclipse is still running in separate JVM. So what you are getting is only a reflection of the code execution. The debug session will end when the serve Eclipse instance is closed or the client Eclipse is disconnected using the disconnect button in the debug view.
1. Host Eclipse: The default eclipse instance is referred to as Host Eclipse. When self-hosting, a new Eclipse is launched from it, it is referred to as Guest Eclipse or Nested Eclipse Instance.