Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ecf-dev] a difficult ECF build issue

Ted,

I don't have any direct experience with building or running Eclipse on a 64-bit platform, but I'll attempt to address some of the more general questions.
So I am trying to debug. If I put src in a workspace, then the plugin works fine in the runtime workbench. But in this case, the src is recompiled. Is there a way of actually running and debugging a downloaded binary (pointing to src files in some way)?
What you can do is:
1. start your target Eclipse in debug mode
2. connect to it from a host Eclipse (on your dev machine)

On your target machine, start Eclipse like this:

./eclipse -vmargs -agentlib:jdwp=suspend=y,transport=dt_socket,server=y,address=`hostname`:8000
You should see the splashscreen come up and this printed to the console:
Listening for transport dt_socket at address: 8000

For more information on the various options please see http://java.sun.com/j2se/1.5.0/docs/guide/jpda/conninv.html#Invocation.

On your host machine, start your Eclipse IDE like you normally do. You should have a separate eclipse directory with all target plugins that your code depends on (including the 64-bit linux versions). Point your Preferences->Plugin Development -> Target Platform to that location and also specify the appropriate platform environment (second tab on that page). This is what your IDE will "see".

Finally, create a debug launch configuration: Run -> Open Debug Dialog... -> Remote Java Application. As the Project, pick something with lots of dependencies so you don't have to manually add them in the Source tab. This just gives you the necessary visibility into your target code (the code compiled in your IDE won't actually be used here). Specify the target hostname and port where you started your target and hit Debug.

At this point you should see your target instance come up and you should be able to set and hit breakpoints in your host IDE.
Here are details ..... 1. I am building Eclipse plugins (headless builds) on a 64-bit computer running Suse 10.2. All the plugins built on this machine build without errors and so far all but one are functional. The plugin that is not functional is the Skype plugin.

2. I should be more specific about non-functional. First of all, the plugin is only non-functional on Windows. It works fine on 32-bit Linux. I have been unable to test it on 64-bit Linux but hope to soon (looking for a platform; our build machine is not practical). The behavior is that Skype appears in the ECF dropdown, but when you select it, nothing happens.

3. When I build the plugin on 32-bit Linux, it is functional on both Windows and Linux. The plugin requires that Skype be installed and running. I have what I think are the latest Skype versions. The Linux Skype looks a lot different than the Windows Skype BTW.

4. If I replace one file in the 150 or so files comprising the Skype plugin built on 64-bit Linux, it becomes functional on both Windows and Linux. The file I must replace is com/skype/connector/windows/WindowsConnector$1.class in com.skype_0.3.0.HEAD.jar. I replace it with the same file built on 32-bit Linux.

5. Originally, the Skype plugin would not build. To get it to build without errors, Scott and I cast a returned value to an int. (We don't believe that there is any important information in the upper bits anyway, but we have been unable to actually look at the bits of the returned long because we so far cannot debug on a 64-bit machine. This returned value is an int when run on 32-bit machines and a long when run on 64-bit machines. The change we made is in the file eclipse/plugins/com.skype/src/com/skype/connector/windows/WindowsConnector.java (around line 221) and is as follows.

       public void run() {

             try {

              display = new Display();

windowClass = new TCHAR(0, "" + System.currentTimeMillis() + (int) (Math.random() * 1000), true);

long tmpMessageReceived = new Callback(WindowsConnector.this, "messageReceived", 4).getAddress();

              int messageReceived = (int) tmpMessageReceived;

             if (messageReceived == 0) {

6. When we built on our 64-bit machine we had to add a 32-bit win plugin to our eclipse/plugins directory so that imports would be resolved. This is a 64-bit Eclipse that we run on this Linux machine so the win32 plugin is not normally there. The plugin I copied is org.eclipse.swt.win32.win32.x86_3.3.0.v3346.jar. This has the same version at the other plugins, but it should not be used to run Eclipse because Eclipse is running on Linux. It seems strange to me that we must add a plugin to the eclipse/plugins directory that eclipse itself does not use, but we could see no other way of resolving references.

Looking at the snippet, I believe TCHAR actually comes from SWT's win32 fragment. This class is not public API, but you can still make it work by isolating platform-specific code into a platform-specific fragment. I'm going to take a look at this specific issue in the source (heaven knows I owe you guys at least that much :-S)

7. The Eclipse that we run on this 64-bit Suse is eclipse-SDK-3.3-linux-gtk-x86_64.tar. The java is from jdk-6u4-linux-x64.bin.

       ted@ecf2:/opt> java -version

       java version "1.6.0_04"

      Java(TM) SE Runtime Environment (build 1.6.0_04-b12)

      Java HotSpot(TM) 64-Bit Server VM (build 10.0-b19, mixed mode)

8. If I check out the Skype files into my workspace on my Windows laptop, the skype plugin works fine. I can set a breakpoint and look at the returned int. However, I do not know a way of actually running the 64-bit built plugin on my laptop and debugging to see where it hangs. Visual Studio has a feature called something like "attach to a running binary" that would let me do something like this? Does Eclipse?

Please let me know if you have any luck with the debugging. Thanks.

--Peter


Back to the top