Skip to content
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

Configurable entrypoints #163

Open
1396510211 opened this issue Apr 27, 2023 · 4 comments
Open

Configurable entrypoints #163

1396510211 opened this issue Apr 27, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@1396510211
Copy link

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
Copy link
Collaborator

There is some support for this in the Datalog code:

//------------------------------------------------------------------------------
// [Marks all funcs as reachable]
//
// This is useful if the artifact to be analyzed doesn't have any
// known entry points (e.g., dynamic library). In such a case, it
// makes sense to treat all funcs defined therein as potential
// entry points.
//------------------------------------------------------------------------------
user_option_valid_value("entrypoints","main").
user_option_valid_value("entrypoints","library").
user_option_default("entrypoints","main").

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
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Author

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

@langston-barrett langston-barrett changed the title Can I configure entry points for the cclyzer? Configurable entrypoints Apr 27, 2023
@langston-barrett langston-barrett added the enhancement New feature or request label Apr 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants