Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Any way to safely step through plugin code that results in popup menus?
Any way to safely step through plugin code that results in popup menus? [message #1713948] Sun, 08 November 2015 20:04 Go to next message
Eclipse UserFriend
On a single laptop, I'm attempting to step through code in an Eclipse plugin. Some of this code results in popup menus being populated and rendered.

While stepping through this code, I ran into a frustrating situation where the system seemed to be "focus deadlocked". A popup menu for the test instance displayed on top of the main instance, and at that point, the only thing I could do was move the mouse cursor. The entire system was essentiallly frozen. I also tried numerous keyboard combinations, none of which appeared to be acknowledged in any way. The only action that did anything useful was the power button, which I eventually resorted to.

I believe one "safer" way of doing things like this is displaying each instance on separate monitors. I believe that's supposed to prevent this sort of deadlock, but I'm not sure. In any case, I won't be able to do that. Is there anything I can set in my Eclipse environment that will prevent these deadlocks from occurring in this situation?
Re: Any way to safely step through plugin code that results in popup menus? [message #1713964 is a reply to message #1713948] Mon, 09 November 2015 03:09 Go to previous messageGo to next message
Eclipse UserFriend
David,

I've run into these kinds of problems debugging drag and drop logic.
Separate monitors does not help; I have that and the problem is the
same. There's only one focus and internally in the code there is only
one Display. In my situation, Ctrl-Atl-Delete helped unlocked the
windowing system. I've certainly never had to power down...


On 09/11/2015 2:04 AM, David M. Karr wrote:
> On a single laptop, I'm attempting to step through code in an Eclipse
> plugin. Some of this code results in popup menus being populated and
> rendered.
>
> While stepping through this code, I ran into a frustrating situation
> where the system seemed to be "focus deadlocked". A popup menu for
> the test instance displayed on top of the main instance, and at that
> point, the only thing I could do was move the mouse cursor. The
> entire system was essentiallly frozen. I also tried numerous keyboard
> combinations, none of which appeared to be acknowledged in any way.
> The only action that did anything useful was the power button, which I
> eventually resorted to.
>
> I believe one "safer" way of doing things like this is displaying each
> instance on separate monitors. I believe that's supposed to prevent
> this sort of deadlock, but I'm not sure. In any case, I won't be able
> to do that. Is there anything I can set in my Eclipse environment
> that will prevent these deadlocks from occurring in this situation?
Re: Any way to safely step through plugin code that results in popup menus? [message #1714050 is a reply to message #1713964] Mon, 09 November 2015 09:51 Go to previous messageGo to next message
Eclipse UserFriend
I'm on a Linux laptop, so I imagine ctrl-alt-del wouldn't help.
Re: Any way to safely step through plugin code that results in popup menus? [message #1714069 is a reply to message #1714050] Mon, 09 November 2015 12:11 Go to previous messageGo to next message
Eclipse UserFriend
David,

I see. Perhaps it has a key combination that locks the desktop? Or
maybe someone using Linux has an idea...

On 09/11/2015 3:51 PM, David M. Karr wrote:
> I'm on a Linux laptop, so I imagine ctrl-alt-del wouldn't help.
Re: Any way to safely step through plugin code that results in popup menus? [message #1714192 is a reply to message #1714069] Tue, 10 November 2015 10:42 Go to previous messageGo to next message
Eclipse UserFriend
For this kind of work, you need to debug from another machine. Launch your app with something like:
-Xdebug -agentlib:jdwp=transport=dt_socket,server=y,address=8000

and create a "Remote Java Application" profile to debug.

I find using a VM to run the app-to-be-debugged works really well.

Brian.
Re: Any way to safely step through plugin code that results in popup menus? [message #1714196 is a reply to message #1714192] Tue, 10 November 2015 11:19 Go to previous messageGo to next message
Eclipse UserFriend
Ok. As I normally run with the very convenient "Debug Eclipse Application", what are some reasonable shortcuts for "exporting" the required workspace environment into the VM, so the test instance running in the VM has the same "stuff" as the original test instance?
Re: Any way to safely step through plugin code that results in popup menus? [message #1714199 is a reply to message #1714196] Tue, 10 November 2015 11:38 Go to previous messageGo to next message
Eclipse UserFriend
You can still launch your debug instance with Eclipse. Duplicate your launch configuration, add the VM args above, and use 'Run' rather than 'Debug'. That should do the trick.

Brian.
Re: Any way to safely step through plugin code that results in popup menus? [message #1714205 is a reply to message #1714199] Tue, 10 November 2015 12:42 Go to previous messageGo to next message
Eclipse UserFriend
I'm confused. I obviously have to have two "boxes" running here. One is a perhaps physical host, and the other is a VM running on the host. My workspace is on the laptop host, and I had been running both the main instance and the test instance on the laptop.

Now, I have to run the test instance on a different "box", perhaps the VM, and define the "Remote Java Application" run configuration on the laptop. What exactly am I doing on the VM? Am I installing Eclipse there? Am I copying my workspace there?
Re: Any way to safely step through plugin code that results in popup menus? [message #1714218 is a reply to message #1714205] Tue, 10 November 2015 14:09 Go to previous messageGo to next message
Eclipse UserFriend
You need Eclipse running on both the host and your guest VM. With most VM software, you can mount your home directory inside the guest VM. What I do is:


  1. mount the source directories in the guest VM;
  2. install Eclipse on the guest VM, and then run Eclipse on a new workspace situated on the VM;
  3. import the source projects;
  4. then launch the app on the VM with the -agentlib:... args.
  5. Back on the host, where the source projects live, configure Eclipse to connect to the Remote Java Application running on the guest VM's IP at the specified port.


Note that the above is only necessary to enable the launch-from-Eclipse (as you mentioned: 'I normally run with the very convenient "Debug Eclipse Application"'). If you had a built app, such as a build produced using Tycho, then you could just launch it directly with the -agentlib:... args.

Brian.
Re: Any way to safely step through plugin code that results in popup menus? [message #1714228 is a reply to message #1714218] Tue, 10 November 2015 17:24 Go to previous messageGo to next message
Eclipse UserFriend
When I import the source projects from the host workspace to the guest workspace, do I need to "copy into workspace", or can I just reference them? Won't just referencing them cause problems if I have both instances running at the same time?
Re: Any way to safely step through plugin code that results in popup menus? [message #1714298 is a reply to message #1714228] Wed, 11 November 2015 09:32 Go to previous messageGo to next message
Eclipse UserFriend
You can import them as a reference rather than copy them. Although it means you'll have two instances writing to the output directories (e.g., bin/), I haven't noticed any problems in practice. The Eclipse on the host won't actually use the .class files.
Re: Any way to safely step through plugin code that results in popup menus? [message #1714582 is a reply to message #1714298] Fri, 13 November 2015 12:00 Go to previous messageGo to next message
Eclipse UserFriend
Ok, well, I have this working. I haven't done much with it, just verified that the debugger connects and it hits breakpoints in the host debugger when I perform actions in the test instance in the VM.
Re: Any way to safely step through plugin code that results in popup menus? [message #1717192 is a reply to message #1714582] Thu, 10 December 2015 11:00 Go to previous message
Eclipse UserFriend
After using this arrangement for a few weeks now, I can report one particular chronic problem with it. The workspace on the guest gets "corrupted" in some way that I'm unable to understand. The only symptom I see is that I start up Eclipse on the guest and it fails to show the source file in the editor view, and there are no projects listed. The error message in the editor view is happening because it can't find the project the source file is associated with. I've posted a question on the forum about this, and filed a bug, but there's been no progress on it. The only workaround I can see that is likely to make a difference is to copy the files into the workspace. That will be very annoying, as I'll have to redo this every time I actually make any changes to the source files on the host, where I'll actually be doing the work. I wonder if it would make sense to set up some sort of "sync" process between them?

Note that I set up the original workspace by simply creating the workspace on the guest, and "Import Existing Projects" and pointing to the shared folder linked to the host. This results in a separate workspace on the guest, but with the project files on the host. Is that the arrangement you were using, or something different?

[Updated on: Thu, 10 December 2015 11:08] by Moderator

Previous Topic:Looking for contributors to complex Eclipse plugin for editing files in a custom language
Next Topic:"Failed to create the Java Virtual Machine."..huh?
Goto Forum:
  


Current Time: Tue Apr 15 01:20:11 EDT 2025

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

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

Back to the top