Ejemplo n.º 1
0
 @Override
 public void dispose() {
   GdbUIPlugin.getDefault()
       .getPreferenceStore()
       .removePropertyChangeListener(fPropertyChangeListener);
   super.dispose();
 }
Ejemplo n.º 2
0
 @Override
 public void buildDelta(
     Object e, final VMDelta parentDelta, final int nodeOffset, final RequestMonitor rm) {
   if (fHideRunningThreadsProperty && e instanceof IResumedDMEvent) {
     // Special handling in the case of hiding the running threads to
     // cause a proper refresh when a thread is resumed.
     // We don't need to worry about the ISuspendedDMEvent in this case
     // because a proper refresh will be triggered anyway by the stack frame
     // being displayed.
     //
     // - If not stepping, update the content of the parent, to allow for
     //   this thread to become hidden.
     // - If stepping, do nothing to avoid too many updates.  If a
     //   time-out is reached before the step completes, the
     //   ISteppingTimedOutEvent will trigger a refresh.
     if (((IResumedDMEvent) e).getReason() != IRunControl.StateChangeReason.STEP) {
       VMDelta ancestorDelta = parentDelta.getParentDelta();
       ancestorDelta.setFlags(ancestorDelta.getFlags() | IModelDelta.CONTENT);
     }
     rm.done();
   } else {
     super.buildDelta(e, parentDelta, nodeOffset, rm);
   }
 }
Ejemplo n.º 3
0
  @Override
  protected void updatePropertiesInSessionThread(IPropertiesUpdate[] updates) {
    IPropertiesUpdate[] parentUpdates = new IPropertiesUpdate[updates.length];

    for (int i = 0; i < updates.length; i++) {
      final IPropertiesUpdate update = updates[i];

      final ViewerCountingRequestMonitor countringRm =
          new ViewerCountingRequestMonitor(ImmediateExecutor.getInstance(), updates[i]);
      int count = 0;

      // Create a delegating update which will let the super-class fill in the
      // standard container properties.
      parentUpdates[i] = new VMDelegatingPropertiesUpdate(updates[i], countringRm);
      count++;

      IMIExecutionDMContext execDmc =
          findDmcInPath(
              update.getViewerInput(), update.getElementPath(), IMIExecutionDMContext.class);
      if (execDmc != null) {
        update.setProperty(ILaunchVMConstants.PROP_ID, Integer.toString(execDmc.getThreadId()));

        // set pin properties
        IPinElementColorDescriptor colorDesc =
            PinCloneUtils.getPinElementColorDescriptor(GdbPinProvider.getPinnedHandles(), execDmc);
        updates[i].setProperty(
            IGdbLaunchVMConstants.PROP_PIN_COLOR,
            colorDesc != null ? colorDesc.getOverlayColor() : null);
        updates[i].setProperty(
            IGdbLaunchVMConstants.PROP_PINNED_CONTEXT,
            PinCloneUtils.isPinnedTo(GdbPinProvider.getPinnedHandles(), execDmc));
      }

      if (update.getProperties().contains(PROP_NAME)
          || update.getProperties().contains(IGdbLaunchVMConstants.PROP_OS_ID)
          || update.getProperties().contains(IGdbLaunchVMConstants.PROP_CORES_ID)) {
        IProcesses processService = getServicesTracker().getService(IProcesses.class);
        final IThreadDMContext threadDmc =
            findDmcInPath(update.getViewerInput(), update.getElementPath(), IThreadDMContext.class);

        if (processService == null || threadDmc == null) {
          update.setStatus(
              new Status(
                  IStatus.ERROR,
                  GdbUIPlugin.PLUGIN_ID,
                  "Service or handle invalid",
                  null)); //$NON-NLS-1$
        } else {
          processService.getExecutionData(
              threadDmc,
              new ViewerDataRequestMonitor<IThreadDMData>(getExecutor(), update) {
                @Override
                public void handleCompleted() {
                  if (isSuccess()) {
                    fillThreadDataProperties(update, getData());
                  }
                  update.setStatus(getStatus());
                  countringRm.done();
                }
              });
          count++;
        }
      }

      countringRm.setDoneCount(count);
    }
    super.updatePropertiesInSessionThread(parentUpdates);
  }