Trait libafl::observers::Observer

source ·
pub trait Observer<S>: Named
where S: UsesInput,
{ // Provided methods fn flush(&mut self) -> Result<(), Error> { ... } fn pre_exec( &mut self, _state: &mut S, _input: &S::Input ) -> Result<(), Error> { ... } fn post_exec( &mut self, _state: &mut S, _input: &S::Input, _exit_kind: &ExitKind ) -> Result<(), Error> { ... } fn pre_exec_child( &mut self, _state: &mut S, _input: &S::Input ) -> Result<(), Error> { ... } fn post_exec_child( &mut self, _state: &mut S, _input: &S::Input, _exit_kind: &ExitKind ) -> Result<(), Error> { ... } fn observes_stdout(&self) -> bool { ... } fn observes_stderr(&self) -> bool { ... } fn observe_stdout(&mut self, stdout: &[u8]) { ... } fn observe_stderr(&mut self, stderr: &[u8]) { ... } }
Expand description

Observers observe different information about the target. They can then be used by various sorts of feedback.

Provided Methods§

source

fn flush(&mut self) -> Result<(), Error>

The testcase finished execution, calculate any changes. Reserved for future use.

source

fn pre_exec(&mut self, _state: &mut S, _input: &S::Input) -> Result<(), Error>

Called right before execution starts.

source

fn post_exec( &mut self, _state: &mut S, _input: &S::Input, _exit_kind: &ExitKind ) -> Result<(), Error>

Called right after execution finishes.

source

fn pre_exec_child( &mut self, _state: &mut S, _input: &S::Input ) -> Result<(), Error>

Called right before execution starts in the child process, if any.

source

fn post_exec_child( &mut self, _state: &mut S, _input: &S::Input, _exit_kind: &ExitKind ) -> Result<(), Error>

Called right after execution finishes in the child process, if any.

source

fn observes_stdout(&self) -> bool

If this observer observes stdout

source

fn observes_stderr(&self) -> bool

If this observer observes stderr

source

fn observe_stdout(&mut self, stdout: &[u8])

React to new stdout To use this, always return true from observes_stdout

source

fn observe_stderr(&mut self, stderr: &[u8])

React to new stderr To use this, always return true from observes_stderr

Implementors§

source§

impl<'a, CM, S, M> Observer<S> for StdCmpObserver<'a, CM, S, M>

source§

impl<'a, S> Observer<S> for BacktraceObserver<'a>
where S: UsesInput,

source§

impl<'a, S, T> Observer<S> for MultiMapObserver<'a, T, false>
where S: UsesInput, T: 'static + Default + Copy + Serialize + DeserializeOwned + Debug, Self: MapObserver,

source§

impl<'a, S, T> Observer<S> for MultiMapObserver<'a, T, true>
where S: UsesInput, T: 'static + Default + Copy + Serialize + DeserializeOwned + Debug, Self: MapObserver,

source§

impl<'a, S, T> Observer<S> for StdMapObserver<'a, T, false>

source§

impl<'a, S, T> Observer<S> for StdMapObserver<'a, T, true>

source§

impl<'a, S, T> Observer<S> for VariableMapObserver<'a, T>

source§

impl<'a, S, T> Observer<S> for RefCellValueObserver<'a, T>

This does not reset the value inside the observer.

source§

impl<'a, S, T> Observer<S> for ValueObserver<'a, T>

This does not reset the value inside the observer.

source§

impl<'a, S, T, const N: usize> Observer<S> for ConstMapObserver<'a, T, N>
where S: UsesInput, T: Default + Copy + 'static + Serialize + DeserializeOwned + Debug, Self: MapObserver,

source§

impl<'map, S> Observer<S> for ConcolicObserver<'map>
where S: UsesInput,

source§

impl<S> Observer<S> for AsanBacktraceObserver
where S: UsesInput,

source§

impl<S> Observer<S> for StdErrObserver
where S: UsesInput,

source§

impl<S> Observer<S> for StdOutObserver
where S: UsesInput,

source§

impl<S> Observer<S> for TimeObserver
where S: UsesInput,

source§

impl<S, M> Observer<S> for HitcountsIterableMapObserver<M>
where for<'it> M: MapObserver<Entry = u8> + Observer<S> + AsIterMut<'it, Item = u8>, S: UsesInput,

source§

impl<S, M> Observer<S> for HitcountsMapObserver<M>
where M: MapObserver<Entry = u8> + Observer<S> + AsMutSlice<Entry = u8>, S: UsesInput,

source§

impl<S, T> Observer<S> for ListObserver<T>

source§

impl<S, T> Observer<S> for OwnedMapObserver<T>
where S: UsesInput, T: 'static + Default + Copy + Serialize + DeserializeOwned + Debug, Self: MapObserver,

source§

impl<S, T, const ITH: bool, const NTH: bool> Observer<S> for ExplicitTracking<T, ITH, NTH>
where S: UsesInput, T: Observer<S>,