Mac OSX 编译和调试 OpenJDK Hotspot 9
Intellij CLion CPU 占用率太高,还出各种奇怪问题,转投 Xcode 调试 hotspot
安装 hg
brew install hg
下载 open idk 9 源代码
hg clone http://hg.openjdk.java.net/jdk9/dev
漫长等待,中间无数次中断
安装 freetype
brew install freetype
configure
bash configure --with-debug-level=slowdebug --with-freetype=/usr/local/opt/freetype --disable-warnings-as-errors
with debug level 设置调试级别,设成 slow debug 可以提供更多的调试信息[br]with free type 设置 free type 路径[br]disable warnings as errors 忽略警告
make
make
构建成功后:[br]jdk -> build/macosx-x86_64-normal-server-slowdebug/jdk[br]hotspot -> build/macosx-x86_64-normal-server-slowdebug/hotspot
Xcode
在 Xcode 中新建 command line 工程,添加 hotspot 源代码到工程中[br]设定 运行目标为 jdk 源码目录下面 build/macosx-x86_64-normal-server-slowdebug/jdk/bin/java
在 jni.cpp 的 JNI_CreateJavaVM 方法中设置断点, goooooo
如果出现 sigsegv 信号中断,可以在 lldb 中设置
(lldb) process handle SIGSEGV --stop=false
上图
关键字:java, hotspot, JDK, xcode
本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!