GaloisInc / cclyzerpp

cclyzer++ is a precise and scalable pointer analysis for LLVM code.
https://galoisinc.github.io/cclyzerpp/
BSD 3-Clause "New" or "Revised" License
134 stars 15 forks source link

Configurable entrypoints #163

Open 1396510211 opened 1 year ago

1396510211 commented 1 year ago

In some scenarios, there is no main function. Is there any way to configure an entry point, such as test(), so that Call Graph can be generated from any root node?

langston-barrett commented 1 year ago

There is some support for this in the Datalog code:

https://github.com/GaloisInc/cclyzerpp/blob/1a64af9ffe1cf6729614ead76157dfb46828cef9/datalog/options/user-options.dl#L79-L91

Ideally, it would be exposed through the command-line options of the FactGenerator, like how context-sensitivity is done now. For now, you could try modifying the default value there. Let me know how that works!

thinkmoore commented 1 year ago

This is not currently configurable, though it ought to be. As a quick hack, you could modify this line to use the name of your entry point.

The right solution is that the reachable_context relation should use the entry_point relation here and here and this relation should be populated via signatures or command line options.

thinkmoore commented 1 year ago

This is not currently configurable, though it ought to be. As a quick hack, you could modify this line to use the name of your entry point.

The right solution is that the reachable_context relation should use the entry_point relation here and here and this relation should be populated via signatures or command line options.

Ooops, it looks like this code might be redundant now with the code @langston-barrett shared. We should clean this up. It would be nice if the user option let you specify some specific functions...

1396510211 commented 1 year ago

Thank you both for your replies. This is exactly what I'm trying to do, it does work, and I hope this can be a configuration item