Example #1
0
 /*
  * (non-Javadoc)
  *
  * @see org.eclipse.e4.languages.javascript.debug.model.IJSDIEventListener#handleEvent(org.eclipse.e4.languages.javascript.jsdi.event.Event, org.eclipse.e4.languages.javascript.debug.model.JSDIDebugTarget, boolean, org.eclipse.e4.languages.javascript.jsdi.event.EventSet)
  */
 public synchronized boolean handleEvent(
     Event event, JSDIDebugTarget target, boolean suspendVote, EventSet eventSet) {
   if (event instanceof SuspendEvent) {
     SuspendEvent suspendEvent = (SuspendEvent) event;
     ThreadReference threadReference = suspendEvent.thread();
     if (threadReference == this.thread) {
       markSuspended();
     }
     return false;
   }
   if (event instanceof StepEvent) {
     StepEvent stepEvent = (StepEvent) event;
     ThreadReference threadReference = stepEvent.thread();
     if (threadReference == this.thread) {
       markSuspended();
     }
     return false;
   }
   return false;
 }
Example #2
0
  /*
   * (non-Javadoc)
   *
   * @see org.eclipse.e4.languages.javascript.debug.model.IJSDIEventListener#eventSetComplete(org.eclipse.e4.languages.javascript.jsdi.event.Event, org.eclipse.e4.languages.javascript.debug.model.JSDIDebugTarget, boolean, org.eclipse.e4.languages.javascript.jsdi.event.EventSet)
   */
  public void eventSetComplete(
      Event event, JSDIDebugTarget target, boolean suspend, EventSet eventSet) {
    if (event instanceof SuspendEvent) {
      SuspendEvent suspendEvent = (SuspendEvent) event;
      ThreadReference threadReference = suspendEvent.thread();
      if (threadReference == this.thread) {
        fireSuspendEvent(DebugEvent.CLIENT_REQUEST);
      }
      EventRequestManager requestManager = thread.virtualMachine().eventRequestManager();
      requestManager.deleteEventRequest(event.request());
      getJSDITarget().removeJSDIEventListener(this, event.request());
    }

    if (event instanceof StepEvent) {
      StepEvent stepEvent = (StepEvent) event;
      ThreadReference threadReference = stepEvent.thread();
      if (threadReference == this.thread) {
        fireSuspendEvent(DebugEvent.STEP_END);
      }
      EventRequestManager requestManager = this.thread.virtualMachine().eventRequestManager();
      requestManager.deleteEventRequest(event.request());
      getJSDITarget().addJSDIEventListener(this, event.request());
    }
  }