History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: IDEA-15651
Type: Bug Bug
Status: Resolved Resolved
Resolution: Won't Fix
Assignee: Eugene Zhuravlev
Reporter: Toomas Römer
Votes: 7
Watchers: 8
Operations

If you were logged in you would be able to see more operations.
IDEA: Feedback

No executable code found at line ...

Created: 11 Oct 07 18:49   Updated: 15 Feb 08 18:22
Component/s: Debugger

File Attachments: 1. Java Source File JavaRebelPositionManager.java (5 kb)

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

Build: 7,126
Severity: Medium


 Description  « Hide
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.



 All   Comments   Work Log   Change History      Sort Order:
Eugene Zhuravlev - 26 Oct 07 16:06
I've checked the problem on a small class and it seems that debug info is stripped: every time debugger tries to add a breakpoint request, the com.sun.jdi.AbsentInformationException is thrown. This is an indication of the lack of debug info.

Pieter Degraeuwe - 26 Oct 07 16:19
What could be the reason of this stripped debug info?
Strange is that it works perfectly with Eclipse....

Eugene Zhuravlev - 26 Oct 07 16:59
I think I've found the reason. The problem is that class names inded get skewed. There is still a class loaded with original qualified name, but it seems like this is merely a generated stub (hence the lack of debug info). IDEA's debugger uses qualified names for positioning (setting the correspondence between source file and compiled class file). Qualified names are also used when creating breakpoint requests to setup exact class filters. This approach allows to reduce the number of debug events from the debuggee and speed up application loading.

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.


Pieter Degraeuwe - 26 Oct 07 17:05
If you can give me some guidelines, I can give it a try (where can I find there OpenAPI docs?..)
Since I might have some spare time, maybe we can work together to solve this issue ?

Jevgeni Kabanov - 26 Oct 07 17:17
AFAIK Eclipse uses the Code class annotations instead of the qualified names. They use it for implementing JSP debugging and similar. Isn't it possible to use same approach in IDEA?

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).


Eugene Zhuravlev - 26 Oct 07 19:28
Thanks Pieter, Jevgeni.
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?

Eugene Zhuravlev - 26 Oct 07 19:47
Jevgeni, what do you mean by saying "Eclipse uses the Code class annotations instead of the qualified names"? Could you elaborate?

Jevgeni Kabanov - 26 Oct 07 21:12
1) There isn't a way to obtain the "skewed" name without JavaRebel API.
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.

Jevgeni Kabanov - 26 Oct 07 21:12
The skewed classes themselves will have a "$$G$" suffix after the original class name if that will help.

Pieter Degraeuwe - 26 Oct 07 22:00
Eugene, I've looked to the Tomcat for creating our own PositionManager.
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 ?

Eugene Zhuravlev - 30 Oct 07 15:40
Hi Pieter, Jevgeni.
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.


Eugene Zhuravlev - 30 Oct 07 20:47
We've decided to delegate the functionality to a dedicated plugin.
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.


Pieter Degraeuwe - 31 Oct 07 00:43
Eugene,

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).


Andrew Perepelytsya - 31 Oct 07 23:53
I think I've found a bug in the plugin (confirmed it several times by enabling and disabling the plugin). The project is running on JDK 1.4.2_16-b05. Installed the 0.1 JavaRebel Debugger plugin from the repo.

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.


Allen George - 01 Nov 07 05:03 - edited
I've just hit this problem as well when I tried to debug an Apache Muse (http://ws.apache.org/muse) based project that's deployed on a remote Tomcat 5.5.25 server.

Eugene Zhuravlev - 01 Nov 07 19:28
Andrew, the plugin must disable its PositionManager if nothing javarebel is not active. If it does not, this is a bug. Please contact plugin developer for this.

Pieter Degraeuwe - 01 Nov 07 19:45
The current version does not 'disable' the PositionManager if JavaRebel is not used.
I'll fix this asap

Eugene Zhuravlev - 01 Nov 07 20:00
Pieter, answering your question about adding -javaagent peremeters....
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.

Pieter Degraeuwe - 10 Nov 07 23:02
Eugene, The only way I see to adapt a special JavaProgramRunner is to configure a special ConfigurationType. Is this correct, or is there a more convenient way?

Eugene Zhuravlev - 14 Nov 07 20:59
Sorry for delay Pieter,
Whyu do you think this is the only way? Just register your runner within the ExecutionRegistry component:
ExecutionRegistry.registerRunner()

Brian Jackson - 15 Feb 08 18:22
Is there a way to do this with the IDEA 6.0.x version of the API? I don't see ExecutionRegistry.registerRunner() or DebuggerManager.registerPositionManagerFactory(Function<DebugProcess,PositionManager> factory) in the 6.0 API.