Is it possible to debug compiled classes instead of the source.

I'm currently working on a project that uses a library that edits classes at runtime. https://github.com/SpongePowered/Mixin/

When debugging, intellij will jump to the source (which is now incorrect), Is there a way to configure intellij to instead decompile the .class files that have been generated in memory? (or failing that, select a directory where the .class files have been dumped for debug purposes) and link that to the debugger frame stack instead?



Attachment(s):
2015-12-22 (1).png
2015-12-22.png
4 comments
Comment actions Permalink

Hi,
getting classes from memory is not implemented yet, vote for https://youtrack.jetbrains.com/issue/IDEA-83442.
If you have generated classes somewhere you can try adding them to the project (so that go to class contain several classes with the same name, but set correct scope so that it does not go to the classpath) and then try to select this class in alternative source notification in debugger.
However right now it does not work because of the bug (https://youtrack.jetbrains.com/issue/IDEA-149611), will fix it soon to allow this workaround.

0
Comment actions Permalink

> If you have generated classes somewhere you can try adding them to the project (so that go to class contain several classes with the same name, but set correct scope so that it does not go to the classpath) and then try to select this class in alternative source notification in debugger.

I would love to do this, what is the correct way to add them to the project?

0
Comment actions Permalink

Put class files into a folder or jar, then add it as a dependency to your module. If needed - set scope to provided (this should remove it from run classpath).

0
Comment actions Permalink

@Egor Ushakov , I put class to folder ,and add it as a dependency to module,but alse can't debug the code bu step. Have you solved the question? If yes,please tell me the way. Thank you .

0

Please sign in to leave a comment.