< prev index next >

src/jdk.jdi/share/classes/com/sun/tools/jdi/VirtualMachineImpl.java

Print this page

 190          * If any thread is resumed, the VM is considered not suspended.
 191          * Just one thread is being resumed so pass it to thaw.
 192          */
 193         state.thaw(action.thread());
 194         return true;
 195     }
 196 
 197     VirtualMachineImpl(VirtualMachineManager manager,
 198                        Connection connection, Process process,
 199                        int sequenceNumber) {
 200         super(null);  // Can't use super(this)
 201         vm = this;
 202 
 203         this.vmManager = (VirtualMachineManagerImpl)manager;
 204         this.process = process;
 205         this.sequenceNumber = sequenceNumber;
 206 
 207         /* Create ThreadGroup to be used by all threads servicing
 208          * this VM.
 209          */
 210         threadGroupForJDI = new ThreadGroup(vmManager.mainGroupForJDI(),

 211                                             "JDI [" +
 212                                             this.hashCode() + "]");

 213 
 214         /*
 215          * Set up a thread to communicate with the target VM over
 216          * the specified transport.
 217          */
 218         target = new TargetVM(this, connection);
 219 
 220         /*
 221          * Set up a thread to handle events processed internally
 222          * the JDI implementation.
 223          */
 224         EventQueueImpl internalEventQueue = new EventQueueImpl(this, target);
 225         new InternalEventHandler(this, internalEventQueue);
 226         /*
 227          * Initialize client access to event setting and handling
 228          */
 229         eventQueue = new EventQueueImpl(this, target);
 230         eventRequestManager = new EventRequestManagerImpl(this);
 231 
 232         target.start();

 815             capabilitiesNew().canRequestVMDeathEvent;
 816     }
 817 
 818     public boolean canRequestMonitorEvents() {
 819         validateVM();
 820         return hasNewCapabilities() &&
 821             capabilitiesNew().canRequestMonitorEvents;
 822     }
 823 
 824     public boolean canGetMonitorFrameInfo() {
 825         validateVM();
 826         return hasNewCapabilities() &&
 827             capabilitiesNew().canGetMonitorFrameInfo;
 828     }
 829 
 830     public boolean canGetModuleInfo() {
 831         validateVM();
 832         return versionInfo().jdwpMajor >= 9;
 833     }
 834 







 835     public void setDebugTraceMode(int traceFlags) {
 836         validateVM();
 837         this.traceFlags = traceFlags;
 838         this.traceReceives = (traceFlags & TRACE_RECEIVES) != 0;
 839     }
 840 
 841     void printTrace(String string) {
 842         System.err.println("[JDI: " + string + "]");
 843     }
 844 
 845     void printReceiveTrace(int depth, String string) {
 846         StringBuilder sb = new StringBuilder("Receiving:");
 847         for (int i = depth; i > 0; --i) {
 848             sb.append("    ");
 849         }
 850         sb.append(string);
 851         printTrace(sb.toString());
 852     }
 853 
 854     private synchronized ReferenceTypeImpl addReferenceType(long id,

 190          * If any thread is resumed, the VM is considered not suspended.
 191          * Just one thread is being resumed so pass it to thaw.
 192          */
 193         state.thaw(action.thread());
 194         return true;
 195     }
 196 
 197     VirtualMachineImpl(VirtualMachineManager manager,
 198                        Connection connection, Process process,
 199                        int sequenceNumber) {
 200         super(null);  // Can't use super(this)
 201         vm = this;
 202 
 203         this.vmManager = (VirtualMachineManagerImpl)manager;
 204         this.process = process;
 205         this.sequenceNumber = sequenceNumber;
 206 
 207         /* Create ThreadGroup to be used by all threads servicing
 208          * this VM.
 209          */
 210         @SuppressWarnings("deprecation")
 211         ThreadGroup group = new ThreadGroup(vmManager.mainGroupForJDI(),
 212                                             "JDI [" +
 213                                             this.hashCode() + "]");
 214         threadGroupForJDI = group;
 215 
 216         /*
 217          * Set up a thread to communicate with the target VM over
 218          * the specified transport.
 219          */
 220         target = new TargetVM(this, connection);
 221 
 222         /*
 223          * Set up a thread to handle events processed internally
 224          * the JDI implementation.
 225          */
 226         EventQueueImpl internalEventQueue = new EventQueueImpl(this, target);
 227         new InternalEventHandler(this, internalEventQueue);
 228         /*
 229          * Initialize client access to event setting and handling
 230          */
 231         eventQueue = new EventQueueImpl(this, target);
 232         eventRequestManager = new EventRequestManagerImpl(this);
 233 
 234         target.start();

 817             capabilitiesNew().canRequestVMDeathEvent;
 818     }
 819 
 820     public boolean canRequestMonitorEvents() {
 821         validateVM();
 822         return hasNewCapabilities() &&
 823             capabilitiesNew().canRequestMonitorEvents;
 824     }
 825 
 826     public boolean canGetMonitorFrameInfo() {
 827         validateVM();
 828         return hasNewCapabilities() &&
 829             capabilitiesNew().canGetMonitorFrameInfo;
 830     }
 831 
 832     public boolean canGetModuleInfo() {
 833         validateVM();
 834         return versionInfo().jdwpMajor >= 9;
 835     }
 836 
 837     @Override
 838     public boolean supportsVirtualThreads() {
 839         validateVM();
 840         return hasNewCapabilities() &&
 841                 capabilitiesNew().supportsVirtualThreads;
 842     }
 843 
 844     public void setDebugTraceMode(int traceFlags) {
 845         validateVM();
 846         this.traceFlags = traceFlags;
 847         this.traceReceives = (traceFlags & TRACE_RECEIVES) != 0;
 848     }
 849 
 850     void printTrace(String string) {
 851         System.err.println("[JDI: " + string + "]");
 852     }
 853 
 854     void printReceiveTrace(int depth, String string) {
 855         StringBuilder sb = new StringBuilder("Receiving:");
 856         for (int i = depth; i > 0; --i) {
 857             sb.append("    ");
 858         }
 859         sb.append(string);
 860         printTrace(sb.toString());
 861     }
 862 
 863     private synchronized ReferenceTypeImpl addReferenceType(long id,
< prev index next >