-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to share context with follow up queries? #9
Comments
The query graph can be used to tell a query which paths to follow. I pointed out details here: |
Hmm ... looks like I'm doing it wrong. Here a sketch of my setup (not syntactically correct): private void runBoomerangQueries(JimpleVal jimpleVal, Unit stmt
final Set<Node<Statement, Val>> parentBoomerangTrace)
BackwardQuery query = BackwardQuery.make(stmt, jimpleVal);
...
SootCallGraph sootGraph = new SootCallGraph();
// here I'm trying to add the results from the previous query ------------
if (parentBoomerangTrace != null) {
parentBoomerangTrace.stream().forEach(node -> {
val method = interproceduralCFG.getMethodOf(getJimpleStatementFromStatement(node.stmt())
.getDelegate());
CallSiteStatement callSiteStatement;
if (node.stmt() instanceof ReturnSiteStatement) {
callSiteStatement = ((ReturnSiteStatement) node.stmt()).getCallSiteStatement();
} else if (node.stmt() instanceof CallSiteStatement) {
callSiteStatement = ((CallSiteStatement) node.stmt());
} else {
callSiteStatement = new CallSiteStatement(node.stmt());
}
sootGraph.addEdge(new CallGraph.Edge(callSiteStatement, JimpleMethod.of(method)));
});
}
BoomerangOptions boomerangOptions = new BoomerangOptions(config);
Boomerang solver = new Boomerang(sootGraph, SootDataFlowScope.make(Scene.v()), boomerangOptions);
BackwardBoomerangResults<Weight.NoWeight> backwardResults = solver.solve(query);
for (ForwardQuery forwardQuery : backwardResults.getAllocationSites().keySet()) {
if (forwardQuery.var() instanceof AllocVal) {
val allocVal = (AllocVal) forwardQuery.var();
if ( ... if the alloc val contains a summary ...) {
val dataFlowPath = backwardResults.getDataFlowPath(forwardQuery);
val value = ((JimpleVal) allocVal.getAllocVal()).getDelegate();
// recursive call with new trace ------------------
runBoomerangQueries(val, allocVal.stmt(), dataFlowPath); But the statement |
Also, I noticed that the |
I have the following test program and want to perform a BackwardQuery for variable
bar
in lineThe query gives me the AllocVal
and from there, I want to start a follow up query for
s
.Currently, the second backward query finds reaching definitions in
entryPoint
,unreleatedMethod1
, andunreleatedMethod2
because the second query doesn't get the call stack from the first.Is there a way to share information between queries in Boomerang?
The text was updated successfully, but these errors were encountered: