247 return myvm; 248 } 249 250 251 VirtualMachineImpl(VirtualMachineManager mgr, int sequenceNumber) 252 throws Exception { 253 super(null); // Can't use super(this) 254 vm = this; 255 256 this.sequenceNumber = sequenceNumber; 257 this.vmmgr = mgr; 258 259 /* Create ThreadGroup to be used by all threads servicing 260 * this VM. 261 */ 262 threadGroupForJDI = new ThreadGroup("JDI [" + 263 this.hashCode() + "]"); 264 265 ((com.sun.tools.jdi.VirtualMachineManagerImpl)mgr).addVirtualMachine(this); 266 267 // By default SA agent classes prefer dbx debugger to proc debugger 268 // and Windows process debugger to windbg debugger. SA expects 269 // special properties to be set to choose other debuggers. We will set 270 // those here before attaching to SA agent. 271 272 System.setProperty("sun.jvm.hotspot.debugger.useProcDebugger", "true"); 273 System.setProperty("sun.jvm.hotspot.debugger.useWindbgDebugger", "true"); 274 } 275 276 // we reflectively use newly spec'ed class because our ALT_BOOTDIR 277 // is 1.4.2 and not 1.5. 278 private static Class vmCannotBeModifiedExceptionClass = null; 279 void throwNotReadOnlyException(String operation) { 280 RuntimeException re = null; 281 if (vmCannotBeModifiedExceptionClass == null) { 282 try { 283 vmCannotBeModifiedExceptionClass = Class.forName("com.sun.jdi.VMCannotBeModifiedException"); 284 } catch (ClassNotFoundException cnfe) { 285 vmCannotBeModifiedExceptionClass = UnsupportedOperationException.class; 286 } 287 } 288 try { 289 re = (RuntimeException) vmCannotBeModifiedExceptionClass.newInstance(); 290 } catch (Exception exp) { 291 re = new RuntimeException(exp.getMessage()); 292 } | 247 return myvm; 248 } 249 250 251 VirtualMachineImpl(VirtualMachineManager mgr, int sequenceNumber) 252 throws Exception { 253 super(null); // Can't use super(this) 254 vm = this; 255 256 this.sequenceNumber = sequenceNumber; 257 this.vmmgr = mgr; 258 259 /* Create ThreadGroup to be used by all threads servicing 260 * this VM. 261 */ 262 threadGroupForJDI = new ThreadGroup("JDI [" + 263 this.hashCode() + "]"); 264 265 ((com.sun.tools.jdi.VirtualMachineManagerImpl)mgr).addVirtualMachine(this); 266 267 // By default SA agent classes prefer Windows process debugger 268 // to windbg debugger. SA expects special properties to be set 269 // to choose other debuggers. We will set those here before 270 // attaching to SA agent. 271 272 System.setProperty("sun.jvm.hotspot.debugger.useWindbgDebugger", "true"); 273 } 274 275 // we reflectively use newly spec'ed class because our ALT_BOOTDIR 276 // is 1.4.2 and not 1.5. 277 private static Class vmCannotBeModifiedExceptionClass = null; 278 void throwNotReadOnlyException(String operation) { 279 RuntimeException re = null; 280 if (vmCannotBeModifiedExceptionClass == null) { 281 try { 282 vmCannotBeModifiedExceptionClass = Class.forName("com.sun.jdi.VMCannotBeModifiedException"); 283 } catch (ClassNotFoundException cnfe) { 284 vmCannotBeModifiedExceptionClass = UnsupportedOperationException.class; 285 } 286 } 287 try { 288 re = (RuntimeException) vmCannotBeModifiedExceptionClass.newInstance(); 289 } catch (Exception exp) { 290 re = new RuntimeException(exp.getMessage()); 291 } |