Beispiel #1
0
  public VirtualMachineProxyImpl(
      DebugProcessImpl debugProcess, @NotNull VirtualMachine virtualMachine) {
    myVirtualMachine = virtualMachine;
    myDebugProcess = debugProcess;

    myVersionHigher_15 = versionHigher("1.5");
    myVersionHigher_14 = myVersionHigher_15 || versionHigher("1.4");

    // avoid lazy-init for some properties: the following will pre-calculate values
    canRedefineClasses();
    canWatchFieldModification();
    canPopFrames();

    try {
      // this will cache classes inside JDI and enable faster search of classes later
      virtualMachine.allClasses();
    } catch (Throwable e) {
      // catch all exceptions in order not to break vm attach process
      // Example:
      // java.lang.IllegalArgumentException: Invalid JNI signature character ';'
      //  caused by some bytecode "optimizers" which break type signatures as a side effect.
      //  solution if you are using JAX-WS: add
      // -Dcom.sun.xml.bind.v2.bytecode.ClassTailor.noOptimize=true to JVM args
      LOG.info(e);
    }

    virtualMachine.topLevelThreadGroups().forEach(this::threadGroupCreated);
  }
 @Override
 public List<ThreadGroupReference> topLevelThreadGroups() {
   return virtualMachine.topLevelThreadGroups();
 }