小编jav*_*her的帖子

将多个调试器连接到debugee(Java,JPDA)

我一直试图在JPDA的上下文中将两个客户端调试器连接到Debuggee程序失败.这是可能的还是有解决方法来实现它?

我使用eclipse作为IDE(编辑拼写错误).将服务器程序视为打开的Hello World:

System.out.println("I have the String"); //1
System.out.println("You will have to pass through the breakpoints before you shall see");
System.out.println("breakpoints");
System.out.println("before you shall see"); //4
Run Code Online (Sandbox Code Playgroud)

我们可以在第1和第4行放置断点.

第1步:在运行配置中传递给程序的参数:

-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y
Run Code Online (Sandbox Code Playgroud)

(server=y告诉vm表现得像服务器一样,suspend=y暗示prog执行将暂停,直到调试器锁定到它)并运行程序.

第2步:转到Debug as , Debug config ,Remote Java application并创建一个新实例:

Project: Same as before
Connection type: Socket Attach(Socket Attach)
Host:LocalHost
Port:8000
Run Code Online (Sandbox Code Playgroud)

现在,当我调试Prog执行时,在指定的断点处停止.我无法做的是创建这个远程调试器的另一个实例,它可以锁定到服务器(prog 1),当我这样做时,我得到一个拒绝连接.如果有其他人遇到此问题并且是否存在解决方法,请告诉我.谢谢!

谢谢

java eclipse debugging

5
推荐指数
1
解决办法
3398
查看次数

标签 统计

debugging ×1

eclipse ×1

java ×1