nitromdf.blogg.se

Open jdk source code
Open jdk source code




open jdk source code open jdk source code

Refer to some of the online solutions, you may fix it with below steps: how to fix it? The core concept is to compile classes with debug information. So the reason is known for the issues I met when debug jdk source code. This time, the variable is displayed correctly. Now I can see the LocalVariableTable attributes are generated, next, debug my class again: Now, I compile my class with option -g to produce debug information including “LocalVariableTable” and then use ”javap -verbose LocalVariableTableTest” to see the bytecodes of this class: When compile source code this is optional and we can choose whether to generate this information, and if not, all the names of local variables will be lost, IDE may take placeholders for displaying. This attribute is important for debugging to bind the variable in source code to local variables in stacks. In JVM specification, we know that code structures contain an attribute naming “LocalVariableTable” which used to describe the local variables. I have a LocalVariableTableTest class, and compile it using javac, then move the manually compiled class file into my target classes folder:Īfter doing this, I set a break-point in line 10 and start to debug, this time we can find out we can’t see the argument number either:Īnd of course I can’t resolve the value of number, because JVM totally has no idea what does this mean.

open jdk source code

That’s too bad, and to explain this, we can test locally. In fact, when compile the java source code in eclipse of rt.jar, oracle chose to remove the debug information so that we can’t debug directly for local variables even if we can see the source code. I met an issue when I wanted to debug jdk source code that eclipse can’t resolve the value of the arguments in functions and it’s not able to see the arguments’ name, however the arguments values are readable in variables view:






Open jdk source code