debug as java 没有,如何调试Java应用程序,无需访问源代码?

I need to debug a Java application I have no source code for. It is running locally on a Jetty server. Decompiling using JD-GUI works fine. Attaching JDB via a socket connection or shared memory works fine, too.

Where I fail is joining the pieces together. I mainly tried Eclipse with the JD-Eclipse plugin and remote debugging. I failed to find a way to successfully attach the debugger to a running process. Everything seems to assume that I have at least parts of the application available as source code in a project, but I have not. And it is quite a large application (200+ MiB of JAR files and 500+ MiB of other stuff) so trying to build a project from all the decompiled classes and getting this to run is not an option unless it is easy to automate.

What I really need is being able to attach a debugger to a running process, see and navigate the decompiled code, set breakpoints and inspect variables and objects. It does not matter if the code could be recompiled. Conditional breakpoints and expression evaluation would be nice to have.

解决方案

You can probably do this with the help of a combination of jd-eclipse and its extension jd-eclipse realignment fragment.

The process for installing this is quite simple:

Install JD-Eclipse following the steps provided in the

JD-Eclipse site (the process is quite simple)

Restart Eclipse

Download Realignment realignment.jd.ide.eclipse_1.0.2.jar

Copy the file to the \dropins

Restart Eclipse

Go to Windows -> Preferences

Navigate to General -> Editors -> File Associations

Select *.class in the File types section, select Realignment for JD

Class File Editor in the Associated editors section and click the

Default button.

Press OK and start debugging!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值