整理Arthas的调试过程
依赖
必须下载对应的
arthas版本进行调试,不能直接使用master进行调试, 使用master会导致字节码和源代码匹配不上
- 下载对应版本源代码,用于Debug调试源代码. 下载地址 https://github.com/alibaba/arthas/releases
- 下载对应版本全量包,用于启动arthas调试,下载地址 https://arthas.gitee.io/download.html
使用全量包的好处是不用在启动arthas的时候去下载依赖.
准备
- 准备一个
SpringBoot应用启动(不一定要SpringBoot,但是需要支持后台运行)+debug参数
-agentlib:jdwp=transport=dt_socket,address=8888,server=y,suspend=y并且启动

- 将下载好的源代码倒入idea,添加remote. 配置Agent Debug配置。

- 添加debug 断点 , 在com.taobao.arthas.core.Arthas启动debug

- 执行as.sh 启动debug

- 展示如图所示

接下来就是command debug了
