Package com.sun.jdi.request

Examples of com.sun.jdi.request.EventRequestManager


    /**
     * Creates and registers a request to handle all thread start events
     */
    protected void createRequest() {
      EventRequestManager manager = getEventRequestManager();
      if (manager != null) {
        try {
          EventRequest req = manager.createThreadStartRequest();
          req.setSuspendPolicy(EventRequest.SUSPEND_NONE);
          req.enable();
          addJDIEventListener(this, req);
          setRequest(req);
        } catch (RuntimeException e) {
View Full Code Here


    /**
     * Creates and registers a request to listen to thread death events.
     */
    protected void createRequest() {
      EventRequestManager manager = getEventRequestManager();
      if (manager != null) {
        try {
          EventRequest req = manager.createThreadDeathRequest();
          req.setSuspendPolicy(EventRequest.SUSPEND_NONE);
          req.enable();
          addJDIEventListener(this, req);
        } catch (RuntimeException e) {
          logError(e);
View Full Code Here

      req = iter.next();
      try {
        if (target.isAvailable() && !isExpired(req)) { // cannot delete
                                // an expired
                                // request
          EventRequestManager manager = target
              .getEventRequestManager();
          if (manager != null) {
            manager.deleteEventRequest(req); // disable & remove
          }
        }
      } catch (VMDisconnectedException e) {
        if (target.isAvailable()) {
          JDIDebugPlugin.log(e);
View Full Code Here

     *                DebugException's status code contains the underlying
     *                exception responsible for the failure.</li>
     *                </ul>
     */
    protected StepRequest createStepRequest(int kind) throws DebugException {
      EventRequestManager manager = getEventRequestManager();
      if (manager == null) {
        requestFailed(
            JDIDebugModelMessages.JDIThread_Unable_to_create_step_request___VM_disconnected__1,
            null);
      }
      try {
        StepRequest request = manager.createStepRequest(fThread,
            StepRequest.STEP_LINE, kind);
        request.setSuspendPolicy(EventRequest.SUSPEND_EVENT_THREAD);
        request.addCountFilter(1);
        attachFiltersToStepRequest(request);
        request.enable();
View Full Code Here

    protected void deleteStepRequest() {
      try {
        StepRequest req = getStepRequest();
        if (req != null) {
          removeJDIEventListener(this, req);
          EventRequestManager manager = getEventRequestManager();
          if (manager != null) {
            manager.deleteEventRequest(req);
          }
        }
      } catch (RuntimeException e) {
        logError(e);
      } finally {
View Full Code Here

   *         <code>false</code>).
   */
  protected WatchpointRequest createWatchpoint(JDIDebugTarget target,
      Field field, boolean access) throws CoreException {
    WatchpointRequest request = null;
    EventRequestManager manager = target.getEventRequestManager();
    if (manager == null) {
      target.requestFailed(
          JDIDebugBreakpointMessages.JavaWatchpoint_Unable_to_create_breakpoint_request___VM_disconnected__1,
          null);
    }
    try {
      if (access) {
        request = manager.createAccessWatchpointRequest(field);
      } else {
        request = manager.createModificationWatchpointRequest(field);
      }
      configureRequest(request, target);
    } catch (VMDisconnectedException e) {
      if (!target.isAvailable()) {
        return null;
View Full Code Here

            waitOutputComplete();
        }
    }

    private void setEventRequests(VirtualMachine vm) {
        EventRequestManager erm = vm.eventRequestManager();

        // Normally, we want all uncaught exceptions.  We request them
        // via the same mechanism as Commands.commandCatchException()
        // so the user can ignore them later if they are not
        // interested.
        // FIXME: this works but generates spurious messages on stdout
        //        during startup:
        //          Set uncaught java.lang.Throwable
        //          Set deferred uncaught java.lang.Throwable
        Commands evaluator = new Commands();
        evaluator.commandCatchException
            (new StringTokenizer("uncaught java.lang.Throwable"));

        ThreadStartRequest tsr = erm.createThreadStartRequest();
        tsr.enable();
        ThreadDeathRequest tdr = erm.createThreadDeathRequest();
        tdr.enable();
    }
View Full Code Here

     */
    @Override
    EventRequest resolveEventRequest(ReferenceType refType)
                                      throws NoSuchFieldException {
        Field field = refType.fieldByName(fieldId);
        EventRequestManager em = refType.virtualMachine().eventRequestManager();
        EventRequest wp = em.createModificationWatchpointRequest(field);
        wp.setSuspendPolicy(suspendPolicy);
        wp.enable();
        return wp;
    }
View Full Code Here

                try {
                    List<Location> locations = ref.locationsOfLine(breakpoint.getLineNumber());

                    // Set a breakpoint at the first location.
                    if (locations.size() >= 1) {
                        EventRequestManager mgr = vm.eventRequestManager();
                        BreakpointRequest req = mgr.createBreakpointRequest(locations.get(0));
                        req.setSuspendPolicy(EventRequest.SUSPEND_EVENT_THREAD);
                        if (breakpoint.getCountFilter() != -1) {
                            req.addCountFilter(breakpoint.getCountFilter());
                        }
                        req.enable();
View Full Code Here

                    List<Location> locations;
                    try {
                        locations = ref.locationsOfLine(bpi.getLineNumber());
                        // Set a breakpoint at the first location.
                        if (locations.size() >= 1) {
                            EventRequestManager mgr = vm.eventRequestManager();
                            BreakpointRequest req = mgr.createBreakpointRequest(locations.get(0));
                            req.setSuspendPolicy(EventRequest.SUSPEND_EVENT_THREAD);
                            if (bpi.getCountFilter() != -1) {
                                req.addCountFilter(bpi.getCountFilter());
                            }
                            // TODO: bpi.setThread(...)
View Full Code Here

TOP

Related Classes of com.sun.jdi.request.EventRequestManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.