JavaFAQ Home » Java Tools
Question: Do you know about "Full Speed
Debugging" and "HotSwap" Class File Replacement in Java Debugger since v.1.4.1?
Answer: Part 2 (1st part was published in
newsletter No 139) "HotSwap" Class File Replacement.
This new feature encapsulates the ability to substitute modified code in a
running application through the debugger APIs. For example, one can recompile a
single class and replace the old instance with the new instance.
This change was made to address these issues:
Tool (IDE) vendors want the ability to do fix-and-continue debugging. That
is, while debugging, identify a problem, fix it, and continue debugging with
fixed code. Organizations deploying long running servers wish to be able to fix
bugs without taking down the server.
HotSwap adds functionality to the JavaTM Platform Debugger Architecture (JPDA)
to allow a class to be updated while under the control of a debugger. The two
central components of this functionality are RedefineClasses which replaces the
class definitions and PopFrame which pops frames off the stack allowing a method
which has been redefined to be re-executed.
In the reference implementation, this functionality is implemented at the
Java Virtual Machine Debug Interface (JVMDI) layer and made available through
the higher layers of JPDA - the Java Debug Wire Protocol (JDWP) and the Java
Debug Interface (JDI).
This tip is based on release info for the version 1.4.1 family of the Java 2
Printer Friendly Page
Send to a Friend
Search here again if you need more info!