Friday, March 9, 2012

Debugging classes without sources

I have to debug some classes, which are not provided with source code in NetBeans.

I have to choose from these options:
1. Switch to Eclipse and use JD-Eclipse. Many people indicates that they use it without problems.
2. Decompile the sources and add them to IDE. In this case we have to an another problem - line numbers. From Java bytecode, IDE knows the lines, where the operations are placed in source code. If lines mismatch, the debugger jumps to wrong numbers - fail.

JD-GUI is nice and useful decompiler, but the code geenrated from it, is in this format:

/* */ void validate(CertPath paramCertPath, List paramList)
/* */ throws CertPathValidatorException
/* */ {
/* 61 */ X509Certificate localX509Certificate = null;
/* 62 */ PKIXCertPathChecker localPKIXCertPathChecker = null;
/* */
/* 69 */ int i = paramList.size();

but the part of the code is placed in line 23 to 29 in decompiled file. So it cannot be used for debug.

TO BE CONTINUED...

No comments:

Post a Comment