[Soot-list] Soot-list Digest, Vol 81, Issue 5

Tezcan Dilshener tezcan at dilshener.de
Mon Jan 9 02:20:32 EST 2012


Hi Eric
when I run it with  -allow-phantom-refs then each class gets marked as phantom and the following line in SootResolver does not find any methods
for( Iterator mIt = sc.getMethods().iterator(); mIt.hasNext(); ) { 

Therefore I get no call invocation information from my below code. Any further ideas? 

	   PackManager.v().getPack("wjtp").add(new Transform("wjtp.myTrans", new SceneTransformer() {
			@Override @SuppressWarnings("rawtypes")
			protected void internalTransform(String phaseName,  Map options) {
			    CHATransformer.v().transform();
			    Iterator<SootClass> cIt = Scene.v().getApplicationClasses().iterator();
			    while (cIt.hasNext()) {
			    	SootClass src = (SootClass) cIt.next();	
				    Iterator<SootMethod> mIt = src.getMethods().listIterator();
				    while (mIt.hasNext()) {		
				    	SootMethod srm = (SootMethod) mIt.next();
						CallGraph cg = Scene.v().getCallGraph();
						Iterator<MethodOrMethodContext> targets = new Targets(cg.edgesOutOf(srm));
						while (targets.hasNext()) {
							SootMethod tgt = (SootMethod)targets.next();
							System.out.println(src + " may call " + tgt);
							if (tgt.getDeclaringClass().isApplicationClass())
								System.out.println(
									tgt.getDeclaringClass().getShortName()+"."+tgt.getName()+"();-;"+
									src.getShortName()+"."+srm.getName()+"();-;");
						}		
				    }
				}
			} 
	   }));
On 08.01.2012, at 11:29, Eric Bodden wrote:

> Hi Tezcan.
> 
>> The exception is misleading because in debug mode, I can see that it is
>> looking for the source file and not for the class file.
>> It is coming form the SootResolver after the following line.
>> ClassSource is = SourceLocator.v().getClassSource(className);
> 
> This is rather odd. Are you using the -allow-phantom-refs option? If
> so then usually Soot should not bother about missing classes.
> 
> Eric

Tezcan Dilshener  

"Subset of all things that we know and believe makes our knowledge."




-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.cs.mcgill.ca/pipermail/soot-list/attachments/20120109/8ac74c37/attachment.html 


More information about the Soot-list mailing list