- Notifications
You must be signed in to change notification settings - Fork1.9k
Is there any way to build call graph path?#7531
-
The codeql document only shows how to generate path query through DataFlow problem.Now i just want to generate call graph path from source to sink and don't want to do any data flow track.Is there a way to do so? |
BetaWas this translation helpful?Give feedback.
All reactions
Have a look at this discussion:#5353 (comment)
Also look at the additional comments from@Marcono1234.
Ithink this is what you want :)
(Quote from the above discussion also copied and pasted below)
Yes, this is possible!
The site you linked to mentions ithere andhere although it's easy too miss or easy to underestimate its potential.
When you use taint or data-flow the
edgespredicate is defined by thePathGraphmodule. But you can also define your ownedgesquery-predicate.A self-defined query-predicate is used in
@agustingianni'sblog post. It's relatively easy to port the code to "Java CodeQL".Here's my code thatonly creates a path for methods itself and not for the (control fl…
Replies: 2 comments 4 replies
-
So you've got a |
BetaWas this translation helpful?Give feedback.
All reactions
-
Now i have one source method and one sink method. I want to know the call graph path from source to sink such as: source() -> func1() -> func2() -> sink(). I don't want to do any data flow tracking. All i just want to get is the call method path from source to sink. So is there any way to do that? |
BetaWas this translation helpful?Give feedback.
All reactions
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
Have a look at this discussion:#5353 (comment) Ithink this is what you want :) (Quote from the above discussion also copied and pasted below)
|
BetaWas this translation helpful?Give feedback.
All reactions
-
It is exactly what i want. Thanks a lot for help! |
BetaWas this translation helpful?Give feedback.
All reactions
-
Likewise, thank you! This should really be added to somewhere official on the CodeQL docs, it's incredibly useful. |
BetaWas this translation helpful?Give feedback.
All reactions
-
incredibly useful |
BetaWas this translation helpful?Give feedback.