facebookexperimental / MIRAI

Rust mid-level IR Abstract Interpreter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Could you please supply a example for "command line options" ?

ffanyq opened this issue · comments

I'm extremely appreciative of your contribution to Rust community. As a beginner, however, it seems a little difficult for me to use some ancillary functions
(e.g. generate a callgraph)

I have been installed the sub-command mirai by
cargo install --locked --path ./checker.

And the MIRAI_FLAGS is set to --call_graph_config ./config
by the command MIRAI_FLAGS="--call_graph_config ./config.json" over my project workspace. The file named 'config.json' is blow:

{
    "call_sites_output_path": "path/to/call_sites.json",
    "dot_output_path": "path/to/graph.dot",
    "reductions": [
        {"Slice": "main"},
        "Fold",
        "Clean",
        "Deduplicate",
    ],
    "included_crates": ["sss"],
    "datalog_config": {
        "ddlog_output_path": "path/to/graph.dat" | "path/to/datalog/",
        "type_map_output_path": "path/to/types.json",
        "type_relations_path": "path/to/type_relations.json",
        "datalog_backend": "DifferentialDatalog" | "Souffle"
    },
}

Lastly, when I use the command cargo mirai, there is no output in my project workspace. But I don't know the correct steps for generating a callgraph.

Are the paths in your config file actual paths? Also, you have to choose the backend to be one of "DifferentialDatalog" or "Souffle", not both or either. Likewise ddlog_output_path should be a single path.

It will also help if you can run this with MIRAI_LOG=info and append the output to this issue.

Are the paths in your config file actual paths? Also, you have to choose the backend to be one of "DifferentialDatalog" or "Souffle", not both or either. Likewise ddlog_output_path should be a single path.

It will also help if you can run this with MIRAI_LOG=info and append the output to this issue.

Thanks for your help, this problem has solved. I forgot to set the flag RUSTC_WRAPPER=mirai.