public SynchObliviousMhpAnalysis() { threadList = new ArrayList<AbstractRuntimeThread>(); optionPrintDebug = false; self = null; buildThreadList(); }
public void printMhpSummary() { if(optionThreaded) { if(self == null) return; // not run... do nothing // Wait until finished G.v().out.println("[mhp] waiting for thread to finish"); try { self.join(); } catch(InterruptedException ie) { return; } } List<AbstractRuntimeThread> threads = new ArrayList<AbstractRuntimeThread>(); int size = threadList.size(); G.v().out.println("[mhp]"); for(int i = 0; i < size; i++) { if( !threads.contains(threadList.get(i)) ) { G.v().out.println("[mhp] " + threadList.get(i).toString().replaceAll( "\n", "\n[mhp] ").replaceAll( ">,",">\n[mhp] ")); G.v().out.println("[mhp]"); } threads.add(threadList.get(i)); } }
public List<SootClass> getThreadClassList() { if(optionThreaded) { if(self == null) return null; // not run... do nothing // Wait until finished G.v().out.println("[mhp] waiting for thread to finish"); try { self.join(); } catch(InterruptedException ie) { return null; } } if(threadList == null) return null; List<SootClass> threadClasses = new ArrayList<SootClass>(); int size = threadList.size(); for(int i = 0; i < size; i++) { AbstractRuntimeThread thread = threadList.get(i); Iterator<Object> threadRunMethodIt = thread.getRunMethods().iterator(); while(threadRunMethodIt.hasNext()) { SootClass threadClass = ((SootMethod) threadRunMethodIt.next()).getDeclaringClass(); // what about subclasses??? if( !threadClasses.contains(threadClass) && threadClass.isApplicationClass() ) // only include application threads threadClasses.add(threadClass); } } return threadClasses; }
public List<AbstractRuntimeThread> getThreads() { if(optionThreaded) { if(self == null) return null; // not run... do nothing // Wait until finished G.v().out.println("[mhp] waiting for thread to finish"); try { self.join(); } catch(InterruptedException ie) { return null; } } if(threadList == null) return null; List<AbstractRuntimeThread> threads = new ArrayList<AbstractRuntimeThread>(); int size = threadList.size(); for(int i = 0; i < size; i++) { if( !threads.contains(threadList.get(i)) ) { threads.add(threadList.get(i)); } } return threads; }
public List<AbstractRuntimeThread> getThreads();