Comments (6)
这个确实有点奇怪,可以下个字节码查看工具,看下哪里不一样的了。 或者自己用 javap 看下具体哪里不一样。
或者试下比较新的jvm。
from dumpclass.
from dumpclass.
from dumpclass.
我使用arthas dump测试一下结果,发现arthas没问题,dump得到的class字节码和javac编译得到的class字节码是一致的。nb。。
from dumpclass.
可能就是 jvm 里处理了一下。
arthas用的是 ClassFileTransformer 来 dump的。可能jvm只保证了这里返回的 byte[] 和 getResource 获取的是一样的。
然后 jvm 真正把 byte[] 加载处理之后,可能据实际情况做一些变换,或者把一些无用数据清理掉都是有可能的。 hsdb dump 下来的,是这个阶段真正运行的字节码。
需要进jvm源码里看下。
from dumpclass.
get~,感谢解惑
from dumpclass.
Related Issues (14)
- 改为自动加载sa-jdi.jar
- 当有重名类时,会出错 HOT 3
- 完善文档,增加没有权限,要sudo的说明
- 想请教一下调ClassDump的main方法时为什么要用反射? HOT 2
- dump出来的文件的权限是 sudo 的权限,需要改进下,不然删除有点麻烦
- 考虑把 pid 参数放到最后面,不然多次执行命令要改pid时,会比较麻烦
- classLoader.hashCode() 有可能多个classloader 的hashcode一样,使用System#identityHashCode 来避免
- mac os 下,默认文件系统是不区分大小写的,导致多个类可能会覆盖
- dumpclass时报java.lang.reflect.InvocationTargetException错误 HOT 1
- jdk 11下面出错 HOT 1
- 参考 org.openjdk.jol.vm.sa.ServiceabilityAgentSupport 解决 jdk 9之后的加载问题?
- 错误: 找不到或无法加载主类 io.github.hengyunabc.dumpclass.DumpMain HOT 2
- it will be stop the JVM?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dumpclass.