Crate symcc_runtime[−][src]
Expand description
SymCC
Runtime Bindings
This crate contains bindings to the SymCC
runtime interface to be used from Rust.
A SymCC
runtime can be used with either SymCC
or SymQEMU
to trace the execution of a target program.
How to use
On a high level, users of this crate can implement the Runtime
trait and export the runtime interface as a cdylib
using the export_runtime
macro.
On a technical level, a SymCC
runtime is a dynamic library (/shared object) that exposes a set of symbols that the instrumentation layer of SymCC
calls into during execution of the target.
Therefore, to create a runtime, a separate crate for the runtime is required, because this is the only way to create a separate dynamic library using cargo.
Goodies
To facilitate common use cases, this crate also contains some pre-built functionality in the form of a tracing::TracingRuntime
that traces the execution to a shared memory region.
It also contains a separate abstraction to easily filter the expressions that make up such a trace in the filter
module.
For example, it contains a filter::NoFloat
filter that concretizes all floating point operations in the trace, because those are usually more difficult to handle than discrete constraints.
Crate setup
Your runtime crate should have the following keys set in its Cargo.toml
:
[profile.release]
panic = "abort"
[profile.debug]
panic = "abort"
[lib]
crate-type = ["cdylib"]
name = "SymRuntime"
Modules
Tracing of expressions in a serialized form.
Macros
This macro allows you to export your runtime from your crate. It is necessary to call this macro in your crate to get a functional runtime.
Structs
This runtime does nothing and concretizes all expressions. Intended for testing purposes.
Traits
This trait encapsulates the full interface of a runtime. The individual methods of this trait are not documented, but follow a simple rules:
Type Definitions
Values of this type identify an expression. They can be thought of as references to expressions.