Project
IntelliJ IDEA
Priority
Normal
Type
Bug
Fix versions
No Fix versions
State
Won't fix
Assignee
Eugene Zhuravlev
Subsystem
Debugger
Affected versions
No Affected versions
Fixed in build
No Fixed in build
  • Created by   Toomas Römer
    4 years ago (11 Oct 2007 19:49)
  • Updated by   Toomas Römer
    3 years ago (15 Feb 2008 19:22)
  • Jira: IDEA-15651
    (history, comments)
 
IDEA-15651 No executable code found at line ...
7
Issue is visible to: All Users
  The issue is visible to the selected user group only
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
Comments (21)
 
History
 
Linked Issues (?)
 
Eugene Zhuravlev
  Eugene Zhuravlev
26 Oct 2007 17:06
4 years ago
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
  Pieter Degraeuwe
26 Oct 2007 17:19
4 years ago
What could be the reason of this stripped debug info?
Strange is that it works perfectly with Eclipse....
Eugene Zhuravlev
  Eugene Zhuravlev
26 Oct 2007 17:59
4 years ago
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
  Pieter Degraeuwe
26 Oct 2007 18:05
4 years ago
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
  Jevgeni Kabanov
26 Oct 2007 18:17
4 years ago
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
  Eugene Zhuravlev
26 Oct 2007 20:28
4 years ago
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
  Eugene Zhuravlev
26 Oct 2007 20:47
4 years ago
Jevgeni, what do you mean by saying "Eclipse uses the Code class annotations instead of the qualified names"? Could you elaborate?
Jevgeni Kabanov
  Jevgeni Kabanov
26 Oct 2007 22:12
4 years ago
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
  Jevgeni Kabanov
26 Oct 2007 22:12
4 years ago
The skewed classes themselves will have a "$$G$" suffix after the original class name if that will help.
Pieter Degraeuwe
  Pieter Degraeuwe
26 Oct 2007 23:00
4 years ago
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
  Eugene Zhuravlev
30 Oct 2007 16:40
4 years ago
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
  Eugene Zhuravlev
30 Oct 2007 21:47
4 years ago
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
  Pieter Degraeuwe
31 Oct 2007 01:43
4 years ago
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
  Andrew Perepelytsya
01 Nov 2007 00:53
4 years ago
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
  Allen George
01 Nov 2007 06:03
4 years ago
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
  Eugene Zhuravlev
01 Nov 2007 20:28
4 years ago
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
  Pieter Degraeuwe
01 Nov 2007 20:45
4 years ago
The current version does not 'disable' the PositionManager if JavaRebel is not used.
I'll fix this asap
Eugene Zhuravlev
  Eugene Zhuravlev
01 Nov 2007 21:00
4 years ago
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
  Pieter Degraeuwe
11 Nov 2007 00:02
4 years ago
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
  Eugene Zhuravlev
14 Nov 2007 21:59
4 years ago
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
  Brian Jackson
15 Feb 2008 19:22
3 years ago
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.