paralegal-flow
supports several options that let you print the intermediate structures of the analyzer.
Be warned that these intermediate representations are primarily intended for developers of paralegal-flow
during debugging, they may be difficult to interpret.
Options are passed to dfpp either via the --dump OPTION
command line argument, which may be specified multiple times, like so: --dump ctrl-mir --dump callee-mir
or as a comma separated list --dump ctrl-mir,callee-mir
or as the PARALEGAL_DUMP
environment variable, or any combination of the mentioned methods.
The table below explains each option and the graph it produces in the order these data structures are used in dfpp.
Output Description | Option | Output Name(s) |
---|---|---|
A JSON serialization of paralegal_spdg::ProgramDescription . Contains all controllers. used by policies and testing. |
Default output | flow-graph.json |
A simple rendering via dot graph of the PDG for a single entrypoint | flowistry-pdg |
<function>.flowistry-pdg.pdf |
A textual rendering of the MIR for the top level function of an entrypoint. | mir |
<function>.mir |
A call-site aggregated rendering of all PDGs | spdg |
call-only-flow.gv |
To use the explorer, use --dump serialized-non-transitive-graph
which should dump a ntgb.json
file, which you can run the explore
command on, e.g. ./explore ctrler.ntgb.json
. The commands are documented in paralegal-explore.rs
.
.gv
(dot) graphsGraph data structures are usually emitted as a .gv
file. This is the “graphviz” graph description language. While the language itself is human readable, it is most convenient to visualize the files with the dot
program (brew install graphviz
with homebrew). For converting the file the easiest command to run is dot -Tpdf -O <file>.gv
or dot -Tpdf -O *.gv
to convert all .gv
files in that directory.