예제 #1
0
 private void populate(Object o) {
   if (o instanceof IStackFrame) {
     IStackFrame f = (IStackFrame) o;
     NesCVariableNameParser varPars =
         new NesCVariableNameParser(
             new NesCSeparatorFromCDTLaunch(f.getDebugTarget().getLaunch()));
     try {
       if (f.hasVariables()) {
         IVariable[] vars = f.getVariables();
         populate(vars, varPars);
       }
     } catch (DebugException e) {
       TinyOSDebugPlugin.getDefault().log("Exception while populating viewer.", e);
     }
   } else {
     clear();
   }
 }
예제 #2
0
  private void antCallStack(boolean sepVM) throws CoreException {
    String fileName = "85769"; // $NON-NLS-1$
    IFile file = getIFile(fileName + ".xml"); // $NON-NLS-1$
    ILineBreakpoint bp = createLineBreakpoint(18, file);
    AntThread thread = null;
    try {
      if (sepVM) {
        fileName += "SepVM"; // $NON-NLS-1$
      }
      thread = launchToLineBreakpoint(fileName, bp);

      IStackFrame[] frames = thread.getStackFrames();

      assertTrue(frames.length == 3);
      IStackFrame frame = frames[0];
      frame.getName().equals(""); // $NON-NLS-1$
    } finally {
      terminateAndRemove(thread);
      removeAllBreakpoints();
    }
  }
 protected boolean isThreadCompatible(Object[] targets) {
   if (targets.length == 1) {
     return true;
   }
   // check if frames from same thread
   Set<IThread> threads = new HashSet<IThread>(targets.length);
   for (int i = 0; i < targets.length; i++) {
     Object object = targets[i];
     IStackFrame frame = null;
     if (object instanceof IStackFrame) {
       frame = (IStackFrame) object;
     } else if (object instanceof IAdaptable) {
       frame = ((IAdaptable) object).getAdapter(IStackFrame.class);
     }
     if (frame != null) {
       if (!threads.add(frame.getThread())) {
         return false;
       }
     }
   }
   return true;
 }
 private String getStackFrameText(IStackFrame frame) {
   return frame.toString();
 }