Java 类com.sun.jdi.request.MethodExitRequest 实例源码

项目:intellij-ce-playground    文件:MethodReturnValueWatcher.java   
private void updateRequestState(final boolean enabled, @Nullable final ThreadReference thread) {
  try {
    final MethodExitRequest request = myRequest;
    if (request != null) {
      myRequest = null;
      myRequestManager.deleteEventRequest(request);
    }
    if (enabled) {
      myLastExecutedMethod = null;
      myLastMethodReturnValue = null;
      myRequest = createRequest(thread);
      myRequest.enable();
    }
  }
  catch (ObjectCollectedException ignored) {
  }
}
项目:tools-idea    文件:MethodReturnValueWatcher.java   
private void updateRequestState(final boolean enabled, @Nullable final ThreadReference thread) {
  try {
    final MethodExitRequest request = myRequest;
    if (request != null) {
      myRequest = null;
      myRequestManager.deleteEventRequest(request);
    }
    if (enabled) {
      myLastExecutedMethod = null;
      myLastMethodReturnValue = null;
      myRequest = createRequest(thread);
      myRequest.enable();
    }
  }
  catch (ObjectCollectedException ignored) {
  }
}
项目:intellij-ce-playground    文件:MethodReturnValueWatcher.java   
private MethodExitRequest createRequest(@Nullable final ThreadReference thread) {
  final MethodExitRequest request = myRequestManager.createMethodExitRequest();
  request.setSuspendPolicy(EventRequest.SUSPEND_NONE);
  if (thread != null) {
    request.addThreadFilter(thread);
  }
  return request;
}
项目:intellij-ce-playground    文件:WildcardMethodBreakpoint.java   
public void createRequest(DebugProcessImpl debugProcess) {
  DebuggerManagerThreadImpl.assertIsManagerThread();
  if (!shouldCreateRequest(debugProcess)) {
    return;
  }
  try {
    RequestManagerImpl requestManager = debugProcess.getRequestsManager();
    if (isWatchEntry()) {
      MethodEntryRequest entryRequest = MethodBreakpoint.findRequest(debugProcess, MethodEntryRequest.class, this);
      if (entryRequest == null) {
        entryRequest = requestManager.createMethodEntryRequest(this);
      }
      else {
        entryRequest.disable();
      }
      entryRequest.addClassFilter(getClassPattern());
      debugProcess.getRequestsManager().enableRequest(entryRequest);
    }
    if (isWatchExit()) {
      MethodExitRequest exitRequest = MethodBreakpoint.findRequest(debugProcess, MethodExitRequest.class, this);
      if (exitRequest == null) {
        exitRequest = requestManager.createMethodExitRequest(this);
      }
      else {
        exitRequest.disable();
      }
      exitRequest.addClassFilter(getClassPattern());
      debugProcess.getRequestsManager().enableRequest(exitRequest);
    }
  }
  catch (Exception e) {
    LOG.debug(e);
  }
}
项目:form-follows-function    文件:F3EventRequest.java   
public static List<MethodExitRequest> wrapMethodExitRequests(
        F3VirtualMachine f3vm, List<MethodExitRequest> reqs) {
    if (reqs == null) {
        return null;
    }
    List<MethodExitRequest> result = new ArrayList<MethodExitRequest>();
    for (MethodExitRequest req : reqs) {
        result.add(wrap(f3vm, req));
    }
    return result;
}
项目:cn1    文件:Main.java   
final String run(String[] args) {
    if (jdb.status != Status.STARTED) {
        return String.format(NOT_VALID_UNTIL_STARTED, "step up");
    }
    MethodExitRequest request = 
        jdb.eventRequestManager.createMethodExitRequest();
    request.addThreadFilter(jdb.thread);
    request.addCountFilter(1);
    request.enable();
    return "Step up to the caller.";
}
项目:tools-idea    文件:MethodReturnValueWatcher.java   
private MethodExitRequest createRequest(@Nullable final ThreadReference thread) {
  final MethodExitRequest request = myRequestManager.createMethodExitRequest();
  request.setSuspendPolicy(EventRequest.SUSPEND_NONE);
  if (thread != null) {
    request.addThreadFilter(thread);
  }
  return request;
}
项目:tools-idea    文件:WildcardMethodBreakpoint.java   
public void createRequest(DebugProcessImpl debugProcess) {
  DebuggerManagerThreadImpl.assertIsManagerThread();
  if (!ENABLED || !debugProcess.isAttached() || debugProcess.areBreakpointsMuted() || !debugProcess.getRequestsManager().findRequests(this).isEmpty()) {
    return;
  }
  try {
    RequestManagerImpl requestManager = debugProcess.getRequestsManager();
    if (WATCH_ENTRY) {
      MethodEntryRequest entryRequest = (MethodEntryRequest)findRequest(debugProcess, MethodEntryRequest.class);
      if (entryRequest == null) {
        entryRequest = requestManager.createMethodEntryRequest(this);
      }
      else {
        entryRequest.disable();
      }
      entryRequest.addClassFilter(myClassPattern);
      debugProcess.getRequestsManager().enableRequest(entryRequest);
    }
    if (WATCH_EXIT) {
      MethodExitRequest exitRequest = (MethodExitRequest)findRequest(debugProcess, MethodExitRequest.class);
      if (exitRequest == null) {
        exitRequest = requestManager.createMethodExitRequest(this);
      }
      else {
        exitRequest.disable();
      }
      exitRequest.addClassFilter(myClassPattern);
      debugProcess.getRequestsManager().enableRequest(exitRequest);
    }
  }
  catch (Exception e) {
    LOG.debug(e);
  }
}
项目:freeVM    文件:Main.java   
final String run(String[] args) {
    if (jdb.status != Status.STARTED) {
        return String.format(NOT_VALID_UNTIL_STARTED, "step up");
    }
    MethodExitRequest request = 
        jdb.eventRequestManager.createMethodExitRequest();
    request.addThreadFilter(jdb.thread);
    request.addCountFilter(1);
    request.enable();
    return "Step up to the caller.";
}
项目:JavaTracer    文件:EventThread.java   
/**
* Create the desired event requests, and enable
* them so that we will get events.
* @param excludes Class patterns for which we don't want events
* @param watchFields Do we want to watch assignments to fields
*/

   void setEventRequests() {

    EventRequestManager mgr = vm.eventRequestManager();
       ExceptionRequest excReq = mgr.createExceptionRequest(null,true, true);
       excReq.setSuspendPolicy(EventRequest.SUSPEND_ALL);
       excReq.enable();

       MethodEntryRequest menr = mgr.createMethodEntryRequest();
       for (int i=0; i<excludes.size(); ++i) {
           menr.addClassExclusionFilter(excludes.get(i));
       }

       menr.setSuspendPolicy(EventRequest.SUSPEND_ALL);
       menr.enable();

       MethodExitRequest mexr = mgr.createMethodExitRequest();
       for (int i=0; i<excludes.size(); ++i) {
           mexr.addClassExclusionFilter(excludes.get(i));
       }
       mexr.setSuspendPolicy(EventRequest.SUSPEND_ALL);
       mexr.enable();

       ThreadDeathRequest tdr = mgr.createThreadDeathRequest();
       tdr.setSuspendPolicy(EventRequest.SUSPEND_ALL);
       tdr.enable();

   }
项目:OpenJSharp    文件:Env.java   
static void addExcludes(MethodExitRequest request) {
    for (String pattern : excludes()) {
        request.addClassExclusionFilter(pattern);
    }
}
项目:jdk8u-jdk    文件:Env.java   
static void addExcludes(MethodExitRequest request) {
    for (String pattern : excludes()) {
        request.addClassExclusionFilter(pattern);
    }
}
项目:openjdk-jdk10    文件:Env.java   
static void addExcludes(MethodExitRequest request) {
    for (String pattern : excludes()) {
        request.addClassExclusionFilter(pattern);
    }
}
项目:openjdk-jdk10    文件:EventRequestManagerImpl.java   
public MethodExitRequest createMethodExitRequest() {
    return new MethodExitRequestImpl();
}
项目:openjdk-jdk10    文件:EventRequestManagerImpl.java   
public List<MethodExitRequest> methodExitRequests() {
    return (List<MethodExitRequest>)unmodifiableRequestList(EventRequestManagerImpl.methodExitEventCmd);
}
项目:openjdk9    文件:Env.java   
static void addExcludes(MethodExitRequest request) {
    for (String pattern : excludes()) {
        request.addClassExclusionFilter(pattern);
    }
}
项目:jdk8u_jdk    文件:Env.java   
static void addExcludes(MethodExitRequest request) {
    for (String pattern : excludes()) {
        request.addClassExclusionFilter(pattern);
    }
}
项目:lookaside_java-1.8.0-openjdk    文件:Env.java   
static void addExcludes(MethodExitRequest request) {
    for (String pattern : excludes()) {
        request.addClassExclusionFilter(pattern);
    }
}
项目:intellij-ce-playground    文件:MethodBreakpoint.java   
protected void createRequestForPreparedClass(@NotNull DebugProcessImpl debugProcess, @NotNull ReferenceType classType) {
  try {
    boolean hasMethod = false;
    for (Iterator iterator = classType.allMethods().iterator(); iterator.hasNext();) {
      Method method = (Method)iterator.next();
      String signature = method.signature();
      String name = method.name();

      if (getMethodName().equals(name) && mySignature.getName(debugProcess).equals(signature)) {
        hasMethod = true;
        break;
      }
    }

    if(!hasMethod) {
      debugProcess.getRequestsManager().setInvalid(
        this, DebuggerBundle.message("error.invalid.breakpoint.method.not.found", classType.name())
      );
      return;
    }

    RequestManagerImpl requestManager = debugProcess.getRequestsManager();
    if (isWatchEntry()) {
      MethodEntryRequest entryRequest = findRequest(debugProcess, MethodEntryRequest.class, this);
      if (entryRequest == null) {
        entryRequest = requestManager.createMethodEntryRequest(this);
      }
      else {
        entryRequest.disable();
      }
      //entryRequest.addClassFilter(myClassQualifiedName);
      // use addClassFilter(ReferenceType) in order to stop on subclasses also!
      entryRequest.addClassFilter(classType);
      debugProcess.getRequestsManager().enableRequest(entryRequest);
    }
    if (isWatchExit()) {
      MethodExitRequest exitRequest = findRequest(debugProcess, MethodExitRequest.class, this);
      if (exitRequest == null) {
        exitRequest = requestManager.createMethodExitRequest(this);
      }
      else {
        exitRequest.disable();
      }
      //exitRequest.addClassFilter(myClassQualifiedName);
      exitRequest.addClassFilter(classType);
      debugProcess.getRequestsManager().enableRequest(exitRequest);
    }
  }
  catch (Exception e) {
    LOG.debug(e);
  }
}
项目:form-follows-function    文件:F3EventRequestManager.java   
public List<MethodExitRequest> methodExitRequests() {
    return F3EventRequest.wrapMethodExitRequests(virtualMachine(),
            underlying().methodExitRequests());
}
项目:form-follows-function    文件:F3MethodExitRequest.java   
public F3MethodExitRequest(F3VirtualMachine f3vm, MethodExitRequest underlying) {
    super(f3vm, underlying);
}
项目:form-follows-function    文件:F3MethodExitRequest.java   
@Override
protected MethodExitRequest underlying() {
    return (MethodExitRequest) super.underlying();
}
项目:form-follows-function    文件:F3EventRequest.java   
public static F3EventRequest wrap(F3VirtualMachine f3vm, EventRequest req) {
    if (req == null) {
        return null;
    }

    if (req instanceof AccessWatchpointRequest) {
        return new F3AccessWatchpointRequest(f3vm, (AccessWatchpointRequest)req);
    } else if (req instanceof BreakpointRequest) {
        return new F3BreakpointRequest(f3vm, (BreakpointRequest)req);
    } else if (req instanceof ClassPrepareRequest) {
        return new F3ClassPrepareRequest(f3vm, (ClassPrepareRequest)req);
    } else if (req instanceof ClassUnloadRequest) {
        return new F3ClassUnloadRequest(f3vm, (ClassUnloadRequest)req);
    } else if (req instanceof ExceptionRequest) {
        return new F3ExceptionRequest(f3vm, (ExceptionRequest)req);
    } else if (req instanceof MethodEntryRequest) {
        return new F3MethodEntryRequest(f3vm, (MethodEntryRequest)req);
    } else if (req instanceof MethodExitRequest) {
        return new F3MethodExitRequest(f3vm, (MethodExitRequest)req);
    } else if (req instanceof ModificationWatchpointRequest) {
        return new F3ModificationWatchpointRequest(f3vm, (ModificationWatchpointRequest)req);
    } else if (req instanceof MonitorContendedEnterRequest) {
        return new F3MonitorContendedEnterRequest(f3vm, (MonitorContendedEnterRequest)req);
    } else if (req instanceof MonitorContendedEnteredRequest) {
        return new F3MonitorContendedEnteredRequest(f3vm, (MonitorContendedEnteredRequest)req);
    } else if (req instanceof MonitorWaitRequest) {
        return new F3MonitorWaitRequest(f3vm, (MonitorWaitRequest)req);
    } else if (req instanceof MonitorWaitedRequest) {
        return new F3MonitorWaitedRequest(f3vm, (MonitorWaitedRequest)req);
    } else if (req instanceof StepRequest) {
        return new F3StepRequest(f3vm, (StepRequest)req);
    } else if (req instanceof ThreadDeathRequest) {
        return new F3ThreadDeathRequest(f3vm, (ThreadDeathRequest)req);
    } else if (req instanceof ThreadStartRequest) {
        return new F3ThreadStartRequest(f3vm, (ThreadStartRequest)req);
    } else if (req instanceof VMDeathRequest) {
        return new F3VMDeathRequest(f3vm, (VMDeathRequest)req);
    } else if (req instanceof WatchpointRequest) {
        return new F3WatchpointRequest(f3vm, (WatchpointRequest)req);
    } else {
        return new F3EventRequest(f3vm, req);
    }
}
项目:form-follows-function    文件:F3EventRequest.java   
public static F3MethodExitRequest wrap(
        F3VirtualMachine f3vm, MethodExitRequest req) {
    return (req == null)? null : new F3MethodExitRequest(f3vm, req);
}
项目:form-follows-function    文件:Env.java   
void addExcludes(MethodExitRequest request) {
    for (String pattern : excludes()) {
        request.addClassExclusionFilter(pattern);
    }
}
项目:infobip-open-jdk-8    文件:Env.java   
static void addExcludes(MethodExitRequest request) {
    for (String pattern : excludes()) {
        request.addClassExclusionFilter(pattern);
    }
}
项目:jdk8u-dev-jdk    文件:Env.java   
static void addExcludes(MethodExitRequest request) {
    for (String pattern : excludes()) {
        request.addClassExclusionFilter(pattern);
    }
}
项目:jdk7-jdk    文件:Env.java   
static void addExcludes(MethodExitRequest request) {
    for (String pattern : excludes()) {
        request.addClassExclusionFilter(pattern);
    }
}
项目:openjdk-source-code-learn    文件:Env.java   
static void addExcludes(MethodExitRequest request) {
    for (String pattern : excludes()) {
        request.addClassExclusionFilter(pattern);
    }
}
项目:OLD-OpenJDK8    文件:Env.java   
static void addExcludes(MethodExitRequest request) {
    for (String pattern : excludes()) {
        request.addClassExclusionFilter(pattern);
    }
}
项目:tools-idea    文件:MethodBreakpoint.java   
protected void createRequestForPreparedClass(@NotNull DebugProcessImpl debugProcess, @NotNull ReferenceType classType) {
  try {
    boolean hasMethod = false;
    for (Iterator iterator = classType.allMethods().iterator(); iterator.hasNext();) {
      Method method = (Method)iterator.next();
      String signature = method.signature();
      String name = method.name();

      if (myMethodName.equals(name) && mySignature.getName(debugProcess).equals(signature)) {
        hasMethod = true;
        break;
      }
    }

    if(!hasMethod) {
      debugProcess.getRequestsManager().setInvalid(
        this, DebuggerBundle.message("error.invalid.breakpoint.method.not.found", classType.name())
      );
      return;
    }

    RequestManagerImpl requestManager = debugProcess.getRequestsManager();
    if (WATCH_ENTRY) {
      MethodEntryRequest entryRequest = (MethodEntryRequest)findRequest(debugProcess, MethodEntryRequest.class);
      if (entryRequest == null) {
        entryRequest = requestManager.createMethodEntryRequest(this);
      }
      else {
        entryRequest.disable();
      }
      //entryRequest.addClassFilter(myClassQualifiedName);
      // use addClassFilter(ReferenceType) in order to stop on subclasses also!
      entryRequest.addClassFilter(classType);
      debugProcess.getRequestsManager().enableRequest(entryRequest);
    }
    if (WATCH_EXIT) {
      MethodExitRequest exitRequest = (MethodExitRequest)findRequest(debugProcess, MethodExitRequest.class);
      if (exitRequest == null) {
        exitRequest = requestManager.createMethodExitRequest(this);
      }
      else {
        exitRequest.disable();
      }
      //exitRequest.addClassFilter(myClassQualifiedName);
      exitRequest.addClassFilter(classType);
      debugProcess.getRequestsManager().enableRequest(exitRequest);
    }
  }
  catch (Exception e) {
    LOG.debug(e);
  }
}
项目:openjdk-jdk7u-jdk    文件:Env.java   
static void addExcludes(MethodExitRequest request) {
    for (String pattern : excludes()) {
        request.addClassExclusionFilter(pattern);
    }
}
项目:openjdk-icedtea7    文件:Env.java   
static void addExcludes(MethodExitRequest request) {
    for (String pattern : excludes()) {
        request.addClassExclusionFilter(pattern);
    }
}
项目:jive    文件:IModelFilter.java   
/**
 * Apply this object's filter to the given event request.
 */
public void filter(MethodExitRequest request);