Skip to content

Commit

Permalink
tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
msridhar committed Aug 28, 2022
1 parent b35cb9b commit fa9d656
Showing 1 changed file with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
*/
package com.ibm.wala.core.tests.callGraph;

import com.ibm.wala.classLoader.CallSiteReference;
import com.ibm.wala.classLoader.IClass;
import com.ibm.wala.classLoader.IMethod;
import com.ibm.wala.core.tests.util.TestConstants;
Expand Down Expand Up @@ -865,11 +866,16 @@ public void testHSQLDB() throws IOException, ClassHierarchyException, CancelExce
AnalysisOptions options = CallGraphTestUtil.makeAnalysisOptions(scope, entrypoints);
options.setReflectionOptions(ReflectionOptions.STRING_ONLY);
CallGraph cg = CallGraphTestUtil.buildZeroCFA(options, new AnalysisCacheImpl(), cha, false);
System.err.println(cg);
// IMethod mainMethod = entrypoints.iterator().next().getMethod();
// List<CGNode> mainCallees =
// Iterator2List.toList(cg.getSuccNodes(cg.getNode(mainMethod, Everywhere.EVERYWHERE)));
// Assert.assertTrue(mainCallees.stream().anyMatch(n ->
// n.toString().contains("getMessage")));
// System.err.println(cg);
for (CGNode node : cg) {
if (!node.toString().contains("ScriptTool, execute")) continue;
System.err.println("CALLER: " + node);
for (CallSiteReference site : Iterator2Iterable.make(node.iterateCallSites())) {
System.err.println("SITE: " + site);
for (CGNode callee : cg.getPossibleTargets(node, site)) {
System.err.println(" CALLEE: " + callee);
}
}
}
}
}

0 comments on commit fa9d656

Please sign in to comment.