[Soot-list] Java->jimple,jimple-> java

lpxz lpxz at ust.hk
Sun Aug 30 02:28:28 EDT 2009


Dear all:
     Do you know what is the reason for the following problem:
by the way, I want to change src code based on AST traverse, then write 
down transformed ast into src code again.Are there any suggestions that 
I can avoid the problem following ? Thanks.

when decompiling to java from jimple:

java.lang.RuntimeException: Could not find enter stmt of the synchBody: 
<dstm2.Thread: java.lang.Object doIt(java.util.concurrent.Callable)>
    at 
soot.dava.toolkits.base.finders.SynchronizedBlockFinder.verify_CatchBody(SynchronizedBlockFinder.java:834)
    at 
soot.dava.toolkits.base.finders.SynchronizedBlockFinder.find(SynchronizedBlockFinder.java:123)
    at soot.dava.DavaBody.<init>(DavaBody.java:326)
    at soot.dava.Dava.newBody(Dava.java:84)
    at soot.PackManager.runBodyPacks(PackManager.java:814)
    at soot.PackManager.runBodyPacks(PackManager.java:455)
    at soot.PackManager.runBodyPacks(PackManager.java:374)
    at soot.PackManager.runPacks(PackManager.java:351)

doIt is like this:
 public static <T> T doIt(Callable<T> xaction) {
    ThreadState threadState = _threadState.get();
   ContentionManager manager = threadState.manager;
    T result = null;
    try {
      while (!Thread.stop) {
        threadState.beginTransaction();
        try {
          result = xaction.call();
        } catch (AbortedException d) {
        } catch (SnapshotException s) {
          threadState.abortTransaction();
        } catch (Exception e) {
          e.printStackTrace();
          throw new PanicException("Unhandled exception " + e);
        }
        threadState.totalMemRefs += threadState.transaction.memRefs;
        if (threadState.commitTransaction()) {
          threadState.committedMemRefs += threadState.transaction.memRefs;
          return result;
        }
        threadState.transaction.attempts++;
        // transaction aborted
      }
      if (threadState.transaction != null) {
        threadState.abortTransaction();
      }
    } finally {
      threadState.transaction = null;
    }
    // collect statistics
    synchronized (lock){
      totalTotalMemRefs = threadState.totalMemRefs;
      totalCommittedMemRefs = threadState.committedMemRefs;
      totalCommitted += threadState.committed;
      totalTotal += threadState.total;
      threadState.reset();  // set up for next iteration
    }
    throw new GracefulException();
  }
Regards
Peng



More information about the Soot-list mailing list