springboot 远程debug
应用:本地打断点,对运行在远程服务器上的程序进行调试
*******************
远程调试
原理:本地jvm程序与远程jvm程序代码保持一致,通过调试协议进行通信
attach 模式:远程服务器暴露端口、开启监听,本地连接远程服务器
listen 模式:本地暴露端口、开启监听,远程应用连接到本地
-Xdebug:开启远程调试
jwdp参数,格式:
-Xrunjwdp:name=value,name2=value2,...
-agentlib:jwdp:name=value,name2=value2,...
jwdp name可选值:
transport:远程debug程序连接方式,dt_socket(默认)、dt_shmem(共享内存)
server:y(debug服务端)、n(默认,debug客户端)
address:server=n时必须设置;server=y时,可不设置
launch:jwdp初始化完成后,启动指定的程序(可选)
onthrow:指定异常发生后,开始jwdp的初始化(可选)
onuncaught:y(未捕获的异常发生后,开始jwdp的初始化)(可选)
n(默认,jwdp正常初始化)
stdalloc:n(默认值),可选
By default, the JDWP reference implementation uses an alternate allocator for its memory allocation.
If “y”, the standard C runtime library allocator will be used. This option is mainly for testing; use it with care.
Deadlocks can occur in this VM if the alternative allocator is disabled
strict:n(默认值),可选
If “y”, assume strict JVMDI conforma