How to debug a class file without source code-eclipse+jad

Source: Internet
Author: User

Elipse debugging function Presumably everyone is already familiar with, although through JDB can achieve the same goal, but the visual debugging tools will greatly improve the efficiency of everyone. Debugging a generic application through eclipse or debugging a server-based program is easy, and clicking the Debug button after setting the breakpoint is OK. Today to introduce how to pass Eclipse+jad to the source code of the class file to debug.
The Jad tool is a very good Java decompile tool that can decompile classs files through Jad, but the line position of the Java file that is compiled by Jad does not correspond to the original class file, which will result in the inability to set breakpoints correctly in Eclipse, by studying, I have come up with no source in the case of the method of setting breakpoints, summed up through the Eclipse+jad debugging without the source code of the program mainly has three steps:

1. Use Jad to reverse compile class and view source file
Be sure to bring the-LNC parameter so that the correct number of rows in the source file is displayed as a comment.

2. Import the modified breakpoint record file using Breakpoints's import.
The breakpoint record file can be modified and then imported after export. If this breakpoint is burning a file:

Breakpoint Enabled=true persistant=true Registered=true
Resource Path=homealonesrcjavacomhaajaxmmsendertest.java
Type=1
Marker Charstart=-1 linenumber=760
Type=org.eclipse.jdt.debug.javalinebreakpointmarker
attrib name=org.eclipse.jdt.debug.core.typename
Value=com.huawei.mm7.vasp.pdu.mm7soapencoder
attrib name=charend value=-1
attrib Name=charstart value=-1
attrib name=org.eclipse.debug.core.enabled value=true
attrib Name=org.eclipse.jdt.debug.ui.member_start
value=285
attrib name=org.eclipse.debug.core.id
Value=org.eclipse.jdt.debug
attrib name=message
Value=line Breakpointmm7soapencoder [Line 760]-main (string[])
attrib Name=org.eclipse.jdt.debug.core.suspendpolicy
value=2
attrib name=org.eclipse.jdt.debug.ui.member_end value=297
attrib name=org.eclipse.jdt.debug.ui.java_element_handle_id
Value==homealonesrcjava<com.ha.ajax{mmsendertest.java[mmsendertest
Marker
Breakpoint

Note Modify: LineNumber property is the number of rows that you want to set a breakpoint, attrib name=org.eclipse.jdt.debug.core.typename
The value is set to the class that you want to debug, and the other properties are basically unmodified.

2.debug
Start Debug, run to the breakpoint will automatically suspend, you can view, modify the value of variables, such as debug operation.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.