コード例 #1
0
    public boolean contains(final String threadId, final String frameId, final String name) {
      final Map<String, Set<String>> threadVars = myData.get(threadId);
      if (threadVars == null) return false;

      final Set<String> frameVars = threadVars.get(frameId);
      if (frameVars == null) return false;

      return frameVars.contains(name);
    }
コード例 #2
0
 private Set<String> collectThreads(RemoteDebugger debugger) {
   Set<String> result = Sets.newHashSet();
   for (Map.Entry<String, RemoteDebugger> entry :
       myMultiProcessDebugger.myThreadRegistry.myThreadIdToDebugger.entrySet()) {
     if (entry.getValue() == debugger) {
       result.add(entry.getKey());
     }
   }
   return result;
 }
コード例 #3
0
    private void put(final String threadId, final String frameId, final String name) {
      Map<String, Set<String>> threadVars = myData.get(threadId);
      if (threadVars == null)
        myData.put(threadId, (threadVars = new HashMap<String, Set<String>>()));

      Set<String> frameVars = threadVars.get(frameId);
      if (frameVars == null) threadVars.put(frameId, (frameVars = new HashSet<String>()));

      frameVars.add(name);
    }
コード例 #4
0
  private void clearTempVariables(final String threadId) {
    final Map<String, Set<String>> threadVars = myTempVars.get(threadId);
    if (threadVars == null || threadVars.size() == 0) return;

    for (Map.Entry<String, Set<String>> entry : threadVars.entrySet()) {
      final Set<String> frameVars = entry.getValue();
      if (frameVars == null || frameVars.size() == 0) continue;

      final String expression = "del " + StringUtil.join(frameVars, ",");
      try {
        evaluate(threadId, entry.getKey(), expression, true);
      } catch (PyDebuggerException e) {
        LOG.error(e);
      }
    }

    myTempVars.clear(threadId);
  }