Is a Java program debuggable only when the VM is running in Debug Mode?
Is there any way to change it at runtime?
2 Answers
No, there's no way to change it at runtime.
If at all possible, you will have to use a profiler
2 Comments
Peica
I found the jinfo is available for changing some flags of VMs. But as you mean it could not be used to turn on something like the Debug mode, am I right?
Peica
~O~. In my mind, I just consider the profiler as an performance analysis. Thanks I will have a try later. I am interested in what it could show out~
I don't believe you can suddenly debug if it's not compiled with the -g option. Your only option is to recompile and redeploy. But once it's in place you can debug at will.
4 Comments
bestsss
the question is about java not gcc
Peica
Does that mean you guys normal use other facilities to find out the system problems like event log except the jdb?
Peica
When a running system meet an issue and the program is not running on debug mode, Should I trace out the problem via the event log?
Peica
In GDB world, I could load the symbols files into the debugger, when I need them. Do you mean the Java could not do it?