Ebay Interview Question
Software DevelopersCountry: United States
The JVM Tool Interface (JVMTI) defines that a VM must provide for debugging. (Editor's note: Starting with Java V5, JVMTI replaced JVMDI, which was used in Java V1.4.) The Java Debug Wire Protocol (JDWP) describes the format of debugging information and requests transferred between the process being debugged and a debugger front end, which implements the JDI, such as Eclipse, Borland JBuilder, and many others. The program being debugged is often called the debuggee in Sun's JPDA specification. The JDI is a high-level interface to define the information and requests used for remote debugging.
Listing 1. The Java Platform Debugger Architecture
Components Debugger Interfaces
/ |--------------|
/ | VM |
debuggee -----( |--------------| <---- JVMTI - Java VM Tool Interface
\ | back-end |
\ |--------------|
/ |
comm channel --( | <------------ JDWP - Java Debug Wire Protocol
\ |
/ |--------------|
/ | front-end |
debugger -----( |--------------| <---- JDI - Java Debug Interface
\ | UI |
\ |--------------|
Listing 2 shows an example of how to launch a VM in debug mode and listen for a socket connection at port 8765.
Listing 2. Target VM acts as a debug server
-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=8765
Listing 3 shows how to attach to a running debugger application using a socket on host 127.0.0.1 at port 8000.
Listing 3. Target VM acts as a debug client
-Xdebug -Xrunjdwp:transport=dt_socket,address=127.0.0.1:8000
Listing 2 shows an example of how to launch a VM in debug mode and listen for a socket connection at port 8765.
Listing 2. Target VM acts as a debug server
-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=8765
Listing 3 shows how to attach to a running debugger application using a socket on host 127.0.0.1 at port 8000.
Listing 3. Target VM acts as a debug client
-Xdebug -Xrunjdwp:transport=dt_socket,address=127.0.0.1:8000
Case:(1):: The JVM Tool Interface (JVMTI) defines that a VM must provide for debugging. (Editor's note: Starting with Java V5, JVMTI replaced JVMDI, which was used in Java V1.4.) The Java Debug Wire Protocol (JDWP) describes the format of debugging information and requests transferred between the process being debugged and a debugger front end, which implements the JDI, such as Eclipse, Borland JBuilder, and many others. The program being debugged is often called the debuggee in Sun's JPDA specification. The JDI is a high-level interface to define the information and requests used for remote debugging.
- Ravindra Seelam July 23, 2015