[−][src]Function haybale::get_possible_return_values_of_func
pub fn get_possible_return_values_of_func<'p>(
funcname: &str,
args: impl IntoIterator<Item = Option<u64>>,
project: &'p Project,
config: Config<'p, DefaultBackend>,
thrown_size: Option<u32>,
n: usize
) -> PossibleSolutions<ReturnValue<u64>>
Get a description of the possible return values of a function, for given argument values. Considers all possible paths through the function given these arguments.
args
: For each function parameter, either a concrete value for that
parameter, or None
to have the analysis consider all possible values of the
parameter.
project
: The Project
(set of LLVM modules) in which symbolic execution
should take place. In the absence of function hooks (see
Config
), we will try to enter calls to any functions
defined in the Project
.
thrown_size
:
If this is None
, then no attempt will be made to distinguish
between different values being thrown. A maximum of one ReturnValue::Throw
will be returned, and it will contain one possible pointer value.
If this is not None
, then it indicates the size in bits
of the value or object expected to be thrown. Many different
ReturnValue::Throw
s may be returned, each containing a distinct possible
value or object (not pointer) which may be thrown.
n
: Maximum number of distinct solutions to check for.
If there are more than n
possible solutions, this returns a
PossibleSolutions::AtLeast
containing at least n+1
solutions.
Note: get_possible_return_values_of_func()
may be of some use itself, but
also serves as an example of how you can use the other public functions in
the crate.