openjdk 单步调试
source link: https://segmentfault.com/a/1190000040821702
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
openjdk 单步调试
大家好,最近搭建了 openjdk 单步调试 环境,看了一些博客,过程中还是耗费很多时间,这次把步骤发出来,希望大家可以作为参照,节省环境搭建的时间。
从 gitee 上面把拉带代码,最好可以fork 一份到自己的仓库,这样以后对源码的修改可以push到远程,在跨设备工作时会更加方便,另外,个人帐号可以设置仓库为私有。
git clone https://gitee.com/mirrors/openjdk.git
切换到指定标签,从指定标签建立新分支。
git tag | grep b120 git checkout jdk8-b120 git checkout -b jdk8-b120
如果是自己的仓库,可以将新分支 push 到远程。
git remote add jdk8-b120 https://gitee.com/xxx/openjdk.git git push jdk8-b120
接下来就是编译源码,是一个有门槛的部分,作为一名JAVA程序员,对c、c++编译,linux系统自带的gcc版本还是比较陌生的,下面会列出组件的版本。
基础环境配置
# gcc gcc version 4.8.5 20150623 # centos CentOS Linux release 7.9.2009 (Core) # bootstrap java java-se-7u75-ri
开始编译,先安装一波系统组件
sudo yum install libXtst-devel libXt-devel \ libXrender-devel cups-devel freetype-devel \ alsa-lib-devel -y
将 /home/xxx/xxx/java-se-7u75-ri 替换为自己的 java
若未采用上面列出的组件版本,这一步很有可能出现问题,可根据问题描述,百度解决的,需要一些耐心。
sudo bash configure --with-target-bits=64 \ --with-boot-jdk=/home/xxx/xxx/java-se-7u75-ri \ --with-debug-level=slowdebug \ --enable-debug-symbols ZIP_DEBUGINFO_FILES=0
这条命令耗时较久,可耐心等待
sudo make all DISABLE_HOTSPOT_OS_VERSION_CHECK=OK ZIP_DEBUGINFO_FILES=0
以上就是编译步骤,每一步都有说明,若大家完成了编译,接下来就是下载IDE,开始调试了。
说起IDE的选择,就比较纠结,尝试过几个IDE,最后选择了 eclipse cpp ,原因就是当初对 C 语言很不了解,边猜边试,试了几个IDE后,在 eclipse cpp 上面很容易就可以调试了,以下就是详细说明。
下载 eclipse cpp,这是国内的 eclipse 镜像站。
https://mirrors.neusoft.edu.cn/eclipse/technology/epp/downloads/release/2020-03/R/eclipse-cpp-2020-03-R-incubation-linux-gtk-x86_64.tar.gz
下载完成直接解压,进入 eclipse 目录使用命令启动 ./eclipse
设置调试配置
开始调试
以上就是本次分享的 单步调试,希望可以帮助到大家,谢谢~
Recommend
-
135
Quality OutreachApache Aries CDIRaymond Auge
-
93
断点单步跟踪是一种低效的调试方法
-
64
-
89
-
71
之前在看汇编的时候一直是肉眼看GCC -S的结果,缺点是很不直观,无法实时的看到寄存器的值,所以研究了下如何用GDB调试汇编。当然,写这篇文章更重要的一个目的是半年没有写博客了,博客要长草了。^_^ 我调试汇编的需求有几点:
-
9
前四节介绍如何定制自己的 linux 内核,以及如何利用 busybox 制作文件系统,如何使用 qemu 模拟器运行编译好的 linux 内核。上一节介绍了在没有界面和鼠标的 linux 环境下,如何使用 gdb 工具单步调试程序。linux 内核也可以看作是一个程序,所以本节将尝试使...
-
7
gdb 没有debug信息step单步调试 2014-08-28 16:21:00 一、如果有函数调用,他会进入该函数 step <count>单步跟踪,如果有函数调用,他会进入该函数。进入函数的...
-
5
关于PHP:Swoole 如何使用 Xdebug 进行单步调试! 用代码保护地球, AI 和 IoT 世界的工程师们准备好了吗?
-
4
很早就想在windows上编译一遍java的源码,最近一直在尝试,中途试了很多方法,遇到了很多坑。最后我把编译过程中遇到的困难和解决方法记录下来,希望对后来者有所帮助。Openjdk 11的源码存放在网址https://hg.openjdk.java.net/jdk-updates...
-
4
SAP UI5 SmartTable 控件本地运行时进行 Excel 导出的单步调试 精选 原创 点击 SmartTable 控件生成的表格控件的 Export to Excel...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK