有什么可视化 JVM 执行字节码的工具吗?就像 https://www.artima.com/insidejvm/ed2/jvm13.html 中 Figure 5-14 所显示的那样。
前一条附言所说的工具果然可以实现我想要的功能,但是那个GitHub Repository的README并不是太友好,所以我在这里分享一下我成功使用的过程。
以下步骤参考pyjvm/README.md at master · MatevzFa/pyjvm和pyjvm/pyjvmgui.py at master · MatevzFa/pyjvm
1. sudo pip2 install pyjvmgui
2. 设置好JAVA_HOME(需要为jdk7)
3. git clone [email protected]:MatevzFa/pyjvm.git
4. python pyjvm/src/pyjvmgui.py main.class.Name(注意:main.class.Name不要包含后缀名,比如.java或.class)
最后会出现下图这样的界面。
如果运行的时候出现如下错误:
Traceback (most recent call last):
File "pyjvm/src/pyjvmgui.py", line 213, in <module>
main()
File "pyjvm/src/pyjvmgui.py", line 70, in main
download_rt()
File "pyjvm/src/pyjvmgui.py", line 168, in download_rt
rt_url = urllib2.urlopen('https://matevzfa.github.io/static/pyjvm/rt.jar')
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 154, in urlopen
return opener.open(url, data, timeout)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 429, in open
response = self._open(req, data)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 447, in _open
'_open', req)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 407, in _call_chain
result = func(*args)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1241, in https_open
context=self._context)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1198, in do_open
raise URLError(err)
urllib2.URLError: <urlopen error [Errno 61] Connection refused>
注释掉download_rt()即可
1
CFM880 2020-09-02 20:07:15 +08:00
|
2
secondwtq 2020-09-02 20:15:56 +08:00
你这不叫可视化,你这就是调试器吧 ...
|