I'm doing remote debugging of a simple application. I'm using JavaRebel (www.zeroturnaround.com/javarebel)
- ) I have selected the output path of the application to be WEB-INF/classes
- ) I've recompiled the project
- ) Attached to the socket
- ) Trying to set a break-point
- ) Getting "No Executable code found at line ..."
- ) The break point is not set
JavaRebel preserves all the debug info as is but the class names are not necessarily the same as originally.
I have no problems debugging applications run with JavaRebel with Eclipse IDE.
Environment: Also tested with builds 6197,6180
java version "1.6.0_01"
Java(TM) SE Runtime Environment (build 1.6.0_01-b06)
Java HotSpot(TM) Client VM (build 1.6.0_01-b06, mixed mode, sharing)
and
java version "1.5.0_06"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode)
Running Linux Linux 2.6.22-2-686 #1 SMP Fri Aug 31 00:24:01 UTC 2007 i686 GNU/Linux
Issue was resolved
Strange is that it works perfectly with Eclipse....
Since the qualified names are altered, I see the only way to solve this problem: via debugger's OpenAPI provide a special position manager that will handle such wrapped classes. I mean we need a special plugin that will provide a correspondence between sources and generated classes.
Since I might have some spare time, maybe we can work together to solve this issue ?
If not, then I am more than willing to help to make the plugin for IDEA. However at the moment there is no SDK for JavaRebel yet, so if Pieter wants to work on this, he best should contact me directly (ekabanov [at] zeroturnaround [dot] com).
Jevgeni, is there a way to unambiguously obtain a "skewed" class name from the original one? Or at least some sign that we are dealing with javarebel-generated class name?
2) I think that Eclipse uses the original filename present in debug info (Code attribute) instead of the class name. However I haven't looked in Eclipse yet, so I am not 100% sure.
Only problem is: I want to use that positionManager in both remote connections (attach debugger to a server) and 'local' debugging (stand-alone app)
How can I achieve this ?
Peter, there are 2 ways to register a custom position manager
- per-configuration, as it is in Tomcat plugin
- register a corresponding factory see
DebuggerManager.registerPositionManagerFactory(Function<DebugProcess,PositionManager> factory);
DebuggerManager.unregisterPositionManagerFactory(Function<DebugProcess, PositionManager> factory);
In the second case your position manager will be added to any debug session as soon the factory remains registered. Note that the factory is allowed to return null value; if this is the case, the value is ignored.
Jevgeni, thanks for clarification. I am currently investigating the possibility to generalize default position manager so that classes skewed by javarebel (or any other agent) are covered by its logic. In the short time we'll come up with the solution whether the default logic is worth changing (there might be performance penalties, need to check this) or it would be more reasonable to delegate the functionality to the dedicated position manager.
As a current workaround, of course, a small plugin with the dedicated position manager is the best solution.
Pieter, please find attached position manager implementation. It works for me on a test project. Note that plugin should disable the positionManager if the application is started without javarebel agent. This can be done by either providing a switch in UI or by unregistering position manager's factory.
Feel free to modify the code as you will find appropriate and place it into the package you like.
Please also don't hesitate to contact me should you have any questions regarding the plugin.
Works like a charm !
I'll test it a bit further. After that I'll post the complete plugin on plugins.intellij.net !
I'll keep you posted.
One more question.. I'd like to know how I can check/manipulate vm parameters (such as -javaagent).
Put several breakpoints in the projects (doesn't have to be a JavaRebel one). Run, stop at the first one. Don't do anything and hit F9 to continue the run - it no longer stops (or at least skips many breakpoints), as my test eventually finishes/fails.
This may not be always reproducible on a small testcase from what I noticed.
I'll fix this asap
I suggest that you create a special JavaProgramRunner (see open API). It can also support remote debugger configurations by just adding the position manager assiming the debuggee you connect to was started with javarebel agent.
Whyu do you think this is the only way? Just register your runner within the ExecutionRegistry component:
ExecutionRegistry.registerRunner()