Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Strategies for debugging a refactoring operation in a custom plugin?
Strategies for debugging a refactoring operation in a custom plugin? [message #1714191] Tue, 10 November 2015 10:32 Go to next message
Eclipse UserFriend
This is a stretch to ask this here, but I'm just looking for ideas for how to debug a problem in a codebase.

I've inherited a somewhat complex Eclipse plugin codebase. It's used for the purpose of editing files in a specific language. I'm pretty new to maintaining Eclipse plugins. The original authors are not easily available.

The language has some similarities to XML (not in the syntax), in that one module can "import" another by name, and specify a prefix to be associated with the symbols from that imported file. The language also has a "use" command, which takes a symbol name that represents sort of a structured type. The symbol name can be with or without a prefix. The structured type can be defined in that module, or in an imported module.

The plugin has a feature whereby I can select the definition of a symbol name and select "Rename" in the "Refactoring" submenu. It will select all the occurrences of that symbol name in the file and prompt me to rename it, just like how the Java editor (and others) work.

The problem is, some of the occurrences it chooses to replace might not be valid. If I selected a symbol name in that module that happens to be the same name as a symbol in an imported module, which is referenced by a prefix in this module, when I select the "Rename" operation, it will mark those prefixed occurrences also, even though they refer to a different symbol.

What's befuddling me is that even though I have full access to the source code of this plugin, I can't figure out where it's determining which symbols to select. I did find a "RenameAction" class, which extends Action and implements ISelectionChangedListener, but nothing in there appears to have this logic. I imagine there must be something "inherent" in what this is doing, such that the logic is already provided in the SDK, I just don't see where this comes in.

I did try setting breakpoints in this code, but I found it was somewhat dangerous. I ended up locking up my entire system when it populated a popup menu while I was at a breakpoint (only the mouse cursor and the power button were operational at this point).

I could use any ideas for tracking this kind of issue in Eclipse plugins. I imagine there are other plugins with similar behavior.
Re: Strategies for debugging a refactoring operation in a custom plugin? [message #1714584 is a reply to message #1714191] Fri, 13 November 2015 12:05 Go to previous messageGo to next message
Eclipse UserFriend
If it matters, this codebase is open-source, and it's on github at https://github.com/xored/yang-ide . I also managed to set up a remote debugging system. I still have my original problem. I can't figure out how it determines which occurrences to select, and where it's doing that selection.
Re: Strategies for debugging a refactoring operation in a custom plugin? [message #1714845 is a reply to message #1714191] Tue, 17 November 2015 03:47 Go to previous messageGo to next message
Eclipse UserFriend
David M. Karr wrote on Tue, 10 November 2015 16:32
I did try setting breakpoints in this code, but I found it was somewhat dangerous. I ended up locking up my entire system when it populated a popup menu while I was at a breakpoint (only the mouse cursor and the power button were operational at this point).


For this particular issue you may want to use printpoints as explained here: http://blog.deepakazad.com/2010/06/print-points-debugging-by-writing-to.html

Stephan
Re: Strategies for debugging a refactoring operation in a custom plugin? [message #1714933 is a reply to message #1714845] Tue, 17 November 2015 12:46 Go to previous messageGo to next message
Eclipse UserFriend
Thanks, but with a remote debugging setup, I don't have to worry about those issues.

I'm making some progress on getting ideas on how the selections might be happening (response to my SO posting), although I've had a setback this morning with a corrupted Eclipse workspace.
Re: Strategies for debugging a refactoring operation in a custom plugin? [message #1714953 is a reply to message #1714933] Tue, 17 November 2015 16:45 Go to previous message
Eclipse UserFriend
I also wrote a SO posting about this: http://stackoverflow.com/questions/33721673/cant-figure-out-how-eclipse-plugin-is-determining-renaming-choices#33721673 .

Someone there gave me a lead, and I was able to track this to where it's missing a check.
Previous Topic:Ubuntu VM running Mars.1 suddenly can't see projects
Next Topic:New workspaces being persistently corrupted
Goto Forum:
  


Current Time: Tue Mar 18 10:43:17 EDT 2025

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

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

Back to the top