|
|
|
[
Permlink
| « Hide
]
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.
What could be the reason of this stripped debug info?
Strange is that it works perfectly with Eclipse.... 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. 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 ? 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). 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? Jevgeni, what do you mean by saying "Eclipse uses the Code class annotations instead of the qualified names"? Could you elaborate?
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. The skewed classes themselves will have a "$$G$" suffix after the original class name if that will help.
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 ? Hi Pieter, Jevgeni.
Peter, there are 2 ways to register a custom position manager
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. 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. Eugene,
Works like a charm ! I'll test it a bit further. After that I'll post the complete plugin on plugins.intellij.net ! One more question.. I'd like to know how I can check/manipulate vm parameters (such as -javaagent). 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. I've just hit this problem as well when I tried to debug an Apache Muse (http://ws.apache.org/muse
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.
The current version does not 'disable' the PositionManager if JavaRebel is not used.
I'll fix this asap 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. 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?
Sorry for delay Pieter,
Whyu do you think this is the only way? Just register your runner within the ExecutionRegistry component: ExecutionRegistry.registerRunner() 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.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||