I want to debug .class
files. For example some from the JDK. I downloaded the sources and attached them.
public File[] listFiles(FilenameFilter paramFilenameFilter) { String[] arrayOfString = list(); // now we here if (arrayOfString == null) return null; .... }
Then I type F6 and move to the next line. After that, I try to watch the value of arrayOfString
but I see the following:
Expression view:
Is it normal a situation? Is there a way to debug?
Update 1:
Update 2:
Update 3:
Variables/Expression view – Shows the declared variables and their values. Press Ctrl+Shift+d or Ctrl+Shift+i on a selected variable or expression to show its value. You can also add a permanent watch on an expression/variable that will then be shown in the Expressions view when debugging is on.
There are two ways to debug a class file. The first way is to set the decompiler preference, and to realign the line number. The second way is to check the debug mode in the decompiler menu bar. When your Eclipse workspace is in debug perspective, the debug mode becomes the default.
Changing a Variable's Value To set a variable go to the Variables view and select the variable you want to change. Right click on the variable and select Change Value... Once you have change the value click ok. The variable now has a new value.
The problem is that the source/class files from the JDK are compiled without debug information and therefore eclipse can't inspect these vars. See this answer for more information.
To solve your problem you need to get a different rt.jar or compile it yourself
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With