For our project we are doing kind of reverse engineering. For that we have to debug a third party jar.
I tried de-compiling that jar with DJ, JAD, but output is source code with compile time errors (say return type is boolean in method prototype, but returning int, broken for loops, etc...).
Now, out of this corrupted source code, there are few .java files, which I want to debug. And I want to attach these few files source code with the corresponding classes in jar.
I googled for this, but not found anything useful. ????
The blocker is that the decompilers most likely are unable to rewrite a source file with correct line numbers. So even if the compiled lib has the appropriate line number information, using the decompiled output out of the box won't work.
You will be able to set breakpoints in method (as long as line number information is available in the compiled class files) even without haveing the source code. You may even be able to read the values of local variables (again, if the classes have been compiled with debug information) but then you have to look at the decompiler output and hope for the best, that the decompiled method is close enough to the real code.
It is not impossible but requires some "manual" work.