Multi-level Virtual Machine Debugging Using the Java Platform Debugger Architecture
Debugging virtual machines (VMs) presents unique challenges, especially meta-circular VMs, which are written in the same language they implement. Making sense of runtime state for such VMs requires insight and interaction at multiple levels of abstraction simultaneously. For example, debugging a Java VM written in Java requires understanding execution state at the source code, bytecode and machine code levels. However, the standard debugging interface for Java, which has a platform-independent execution model, is itself platform-independent. By definition, such an interface provides no access to platform-specific details such as machine code state, stack and register values. Debuggers for low-level languages such as C and C++, on the other hand, have direct access only to low-level information from which they must synthesize higher-level views of execution state. An ideal debugger for a meta-circular VM would be a hybrid: one that uses standard platform-independent debugger interfaces but which also interacts with the execution environment in terms of low-level, platform-dependent state.
This paper presents such a hybrid architecture for the meta-circular Maxine VM. This architecture adopts unchanged a standard debugging interface, the Java Platform Debugger Architecture (JPDA), in combination with the highly extensible NetBeans Integrated Development Environment. Using an extension point within the interface, additional machine-level information can be exchanged between a specialized server associated with the VM and plug-in extensions within NetBeans.
Unable to display preview. Download preview PDF.
- 1.Alpern, B., Attanasio, C.R., Cocchi, A., Hummel, S.F., Lieber, D., Mergen, M., Shepherd, J.C., Smith, S.: Implementing jalapeño in Java. In: OOPSLA 1999: Proceedings of the 14th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications, pp. 314–324. ACM Press, New York (1999)CrossRefGoogle Scholar
- 2.Dmitriev, M.: Safe class and data evolution in large and long-lived JavaTM applications. Technical report, Sun Microsystems Laboratories (2001)Google Scholar
- 3.Dmitriev, M.: Towards flexible and safe technology for runtime evolution of Java language applications. In: Proceedings of the Workshop on Engineering Complex Object-Oriented Systems for Evolution, in association with OOPSLA 2001 International Conference (2001)Google Scholar
- 4.Gosling, J., Joy, B., Steele, G., Bracha, G.: JavaTM Language Specification, 3rd edn. Java Series. Addison-Wesley Professional, Reading (2005)Google Scholar
- 5.Liang, S.: The Java Native Interface: Programmers Guide and Specification. Addison-Wesley Publishing Co., Inc., Reading (1999)Google Scholar
- 10.Sun Microsystems, Inc.: Java Dynamic Proxy Classes (1999), http://java.sun.com/j2se/1.5.0/docs/guide/reflection/proxy.html
- 11.Sun Microsystems, Inc.: Java Debug Interface (2004), http://java.sun.com/javase/6/docs/jdk/api/jpda/jdi/index.html
- 12.Sun Microsystems, Inc.: Java Debug Wire Protocol (2004), http://java.sun.com/javase/6/docs/technotes/guides/jpda/jdwp-spec.html
- 13.Sun Microsystems, Inc.: Java Platform Debugger Architecture (2004), http://java.sun.com/javase/6/docs/technotes/guides/jpda/
- 14.Sun Microsystems, Inc.: NetBeans (2009), http://www.netbeans.org
- 15.Ungar, D., Spitz, A., Ausch, A.: Constructing a metacircular virtual machine in an exploratory programming environment. In: OOPSLA 2005: Companion to the 20th annual ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications, pp. 11–20. ACM, New York (2005)CrossRefGoogle Scholar