Is it possible to view variables, passed as arguments in function, if class was compiled without debug flag? I successfully put breakpoint on call, but after that i don't know how to view arguments value. I don't have good source code, soft is obsuficated. Function like this: void a(int var1, boolean var2) - so, i want print var1 & print var2.
Asked
Active
Viewed 4,897 times
2 Answers
8
Compile code with javac -g MyClass.java
. This will allow you to watch local variables when using jdb MyClass

newJ
- 81
- 1
- 2
-2
I use Eclipse Java debugger. I am able to view arguments passed to method in "Variables" view.
Checkout this tutorial links :
http://www.vogella.de/articles/EclipseDebugging/article.html
http://www.developer.com/java/other/article.php/2221711/Debugging-a-Java-Program-with-Eclipse.htm

YoK
- 14,329
- 4
- 49
- 67
-
I don't have source code, only compiled(without debug option) class. I try eclipse and can't find how to debug without source there. – cdump Sep 05 '10 at 13:55
-
You can use some decompiler like JAD , to get sources. You can install Jode plugin on eclipse for decompiling. – YoK Sep 05 '10 at 17:16
-
why negative marking ??? as per stackoverflow ethics one needs to give reason for same. – YoK Mar 29 '13 at 06:28