What does “__JVM_DefineClass__” as a classloader location mean?

送分小仙女□ 提交于 2020-01-03 18:02:48

问题


I am debugging the reason as to why eclipse cannot load the source code when remote debugging dynamically compiled and loaded classes. I am seeing with the -verbose:class argument that my dynamically compiled class files are coming from __JVM_DefineClass__. I assume this to mean that they come from the JVM heapspace itself, as I have the compiler output the compiled bytes into a "FileManager" that caches the compiled bytes in memory.

It seems that the only way for the source to be view-able when debugging is if I specify in the source lookup path where the actual loaded class came from... and it doesn't seem to work if I specify the directory where the class is being compiled from. I feel that if I save the compiled bytes to disk, the source loading might work.

So, what does __JVM_DefineClass__ mean? Is my assumption correct?


回答1:


It means a location URL was not included in the CodeSource in the ProtectionDomain when defineClass was called by the ClassLoader. This could be because the class was dynamically generated, but it could also be because the ClassLoader simply didn't provide the information when it defined the class.



来源:https://stackoverflow.com/questions/23156400/what-does-jvm-defineclass-as-a-classloader-location-mean

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!