diff --git a/libafl/src/feedbacks/map.rs b/libafl/src/feedbacks/map.rs index 2f97411d0c..648397a57c 100644 --- a/libafl/src/feedbacks/map.rs +++ b/libafl/src/feedbacks/map.rs @@ -4,7 +4,7 @@ use alloc::{ string::{String, ToString}, vec::Vec, }; -use core::marker::PhantomData; +use core::{fmt::Debug, marker::PhantomData}; use num_traits::PrimInt; use serde::{Deserialize, Serialize}; @@ -275,6 +275,7 @@ where pub fn with_observer(map_observer: &O) -> Self where O: MapObserver, + T: Debug, { Self { history_map: vec![T::default(); map_observer.len()], @@ -298,7 +299,7 @@ where #[serde(bound = "T: serde::de::DeserializeOwned")] pub struct MapFeedback where - T: PrimInt + Default + Copy + 'static + serde::Serialize + serde::de::DeserializeOwned, + T: PrimInt + Default + Copy + 'static + serde::Serialize + serde::de::DeserializeOwned + Debug, R: Reducer, O: MapObserver, MF: MapFindFilter, @@ -319,7 +320,7 @@ where impl Feedback for MapFeedback where - T: PrimInt + Default + Copy + 'static + serde::Serialize + serde::de::DeserializeOwned, + T: PrimInt + Default + Copy + 'static + serde::Serialize + serde::de::DeserializeOwned + Debug, R: Reducer, O: MapObserver, MF: MapFindFilter, @@ -428,7 +429,7 @@ where impl Named for MapFeedback where - T: PrimInt + Default + Copy + 'static + serde::Serialize + serde::de::DeserializeOwned, + T: PrimInt + Default + Copy + 'static + serde::Serialize + serde::de::DeserializeOwned + Debug, R: Reducer, MF: MapFindFilter, O: MapObserver, @@ -449,7 +450,8 @@ where + 'static + serde::Serialize + serde::de::DeserializeOwned - + PartialOrd, + + PartialOrd + + Debug, R: Reducer, MF: MapFindFilter, O: MapObserver, diff --git a/libafl/src/observers/map.rs b/libafl/src/observers/map.rs index b1f82ce00d..8e26c4be95 100644 --- a/libafl/src/observers/map.rs +++ b/libafl/src/observers/map.rs @@ -6,6 +6,7 @@ use alloc::{ vec::Vec, }; use core::{ + fmt::Debug, hash::Hasher, slice::{from_raw_parts, from_raw_parts_mut}, }; @@ -26,7 +27,7 @@ use crate::{ /// A [`MapObserver`] observes the static map, as oftentimes used for afl-like coverage information pub trait MapObserver: HasLen + Named + serde::Serialize + serde::de::DeserializeOwned where - T: PrimInt + Default + Copy, + T: PrimInt + Default + Copy + Debug, { /// Get the map if the observer can be represented with a slice fn map(&self) -> Option<&[T]>; @@ -117,7 +118,7 @@ where impl<'a, I, S, T> Observer for StdMapObserver<'a, T> where - T: PrimInt + Default + Copy + 'static + serde::Serialize + serde::de::DeserializeOwned, + T: PrimInt + Default + Copy + 'static + serde::Serialize + serde::de::DeserializeOwned + Debug, Self: MapObserver, { #[inline] @@ -148,7 +149,7 @@ where impl<'a, T> MapObserver for StdMapObserver<'a, T> where - T: PrimInt + Default + Copy + 'static + serde::Serialize + serde::de::DeserializeOwned, + T: PrimInt + Default + Copy + 'static + serde::Serialize + serde::de::DeserializeOwned + Debug, { #[inline] fn map(&self) -> Option<&[T]> { @@ -232,7 +233,7 @@ where impl<'a, I, S, T, const N: usize> Observer for ConstMapObserver<'a, T, N> where - T: PrimInt + Default + Copy + 'static + serde::Serialize + serde::de::DeserializeOwned, + T: PrimInt + Default + Copy + 'static + serde::Serialize + serde::de::DeserializeOwned + Debug, Self: MapObserver, { #[inline] @@ -263,7 +264,7 @@ where impl<'a, T, const N: usize> MapObserver for ConstMapObserver<'a, T, N> where - T: PrimInt + Default + Copy + 'static + serde::Serialize + serde::de::DeserializeOwned, + T: PrimInt + Default + Copy + 'static + serde::Serialize + serde::de::DeserializeOwned + Debug, { #[inline] fn usable_count(&self) -> usize { @@ -354,7 +355,7 @@ where impl<'a, I, S, T> Observer for VariableMapObserver<'a, T> where - T: PrimInt + Default + Copy + 'static + serde::Serialize + serde::de::DeserializeOwned, + T: PrimInt + Default + Copy + 'static + serde::Serialize + serde::de::DeserializeOwned + Debug, Self: MapObserver, { #[inline] @@ -385,7 +386,7 @@ where impl<'a, T> MapObserver for VariableMapObserver<'a, T> where - T: PrimInt + Default + Copy + 'static + serde::Serialize + serde::de::DeserializeOwned, + T: PrimInt + Default + Copy + 'static + serde::Serialize + serde::de::DeserializeOwned + Debug, { #[inline] fn map(&self) -> Option<&[T]> { @@ -579,7 +580,7 @@ where impl<'a, I, S, T> Observer for MultiMapObserver<'a, T> where - T: PrimInt + Default + Copy + 'static + serde::Serialize + serde::de::DeserializeOwned, + T: PrimInt + Default + Copy + 'static + serde::Serialize + serde::de::DeserializeOwned + Debug, Self: MapObserver, { #[inline] @@ -610,7 +611,7 @@ where impl<'a, T> MapObserver for MultiMapObserver<'a, T> where - T: PrimInt + Default + Copy + 'static + serde::Serialize + serde::de::DeserializeOwned, + T: PrimInt + Default + Copy + 'static + serde::Serialize + serde::de::DeserializeOwned + Debug, { #[inline] fn map(&self) -> Option<&[T]> { diff --git a/libafl/src/stages/calibrate.rs b/libafl/src/stages/calibrate.rs index 7978256dfc..624f778964 100644 --- a/libafl/src/stages/calibrate.rs +++ b/libafl/src/stages/calibrate.rs @@ -15,14 +15,14 @@ use alloc::{ string::{String, ToString}, vec::Vec, }; -use core::{marker::PhantomData, time::Duration}; +use core::{fmt::Debug, marker::PhantomData, time::Duration}; use num_traits::PrimInt; use serde::{Deserialize, Serialize}; #[derive(Clone, Debug)] pub struct CalibrationStage where - T: PrimInt + Default + Copy + 'static + serde::Serialize + serde::de::DeserializeOwned, + T: PrimInt + Default + Copy + 'static + serde::Serialize + serde::de::DeserializeOwned + Debug, C: Corpus, E: Executor + HasObservers, I: Input, @@ -42,7 +42,7 @@ const CAL_STAGE_MAX: usize = 8; impl Stage for CalibrationStage where - T: PrimInt + Default + Copy + 'static + serde::Serialize + serde::de::DeserializeOwned, + T: PrimInt + Default + Copy + 'static + serde::Serialize + serde::de::DeserializeOwned + Debug, C: Corpus, E: Executor + HasObservers, I: Input, @@ -210,7 +210,7 @@ crate::impl_serdeany!(PowerScheduleMetadata); impl CalibrationStage where - T: PrimInt + Default + Copy + 'static + serde::Serialize + serde::de::DeserializeOwned, + T: PrimInt + Default + Copy + 'static + serde::Serialize + serde::de::DeserializeOwned + Debug, C: Corpus, E: Executor + HasObservers, I: Input, diff --git a/libafl/src/stages/power.rs b/libafl/src/stages/power.rs index ef37673409..b59b556242 100644 --- a/libafl/src/stages/power.rs +++ b/libafl/src/stages/power.rs @@ -1,7 +1,7 @@ //! The power schedules. This stage should be invoked after the calibration stage. use alloc::string::{String, ToString}; -use core::marker::PhantomData; +use core::{fmt::Debug, marker::PhantomData}; use num_traits::PrimInt; use crate::{ @@ -34,7 +34,7 @@ const HAVOC_MAX_MULT: f64 = 64.0; #[derive(Clone, Debug)] pub struct PowerMutationalStage where - T: PrimInt + Default + Copy + 'static + serde::Serialize + serde::de::DeserializeOwned, + T: PrimInt + Default + Copy + 'static + serde::Serialize + serde::de::DeserializeOwned + Debug, C: Corpus, E: Executor + HasObservers, I: Input, @@ -55,7 +55,7 @@ where impl MutationalStage for PowerMutationalStage where - T: PrimInt + Default + Copy + 'static + serde::Serialize + serde::de::DeserializeOwned, + T: PrimInt + Default + Copy + 'static + serde::Serialize + serde::de::DeserializeOwned + Debug, C: Corpus, E: Executor + HasObservers, I: Input, @@ -156,7 +156,7 @@ where impl Stage for PowerMutationalStage where - T: PrimInt + Default + Copy + 'static + serde::Serialize + serde::de::DeserializeOwned, + T: PrimInt + Default + Copy + 'static + serde::Serialize + serde::de::DeserializeOwned + Debug, C: Corpus, E: Executor + HasObservers, I: Input, @@ -183,7 +183,7 @@ where impl PowerMutationalStage where - T: PrimInt + Default + Copy + 'static + serde::Serialize + serde::de::DeserializeOwned, + T: PrimInt + Default + Copy + 'static + serde::Serialize + serde::de::DeserializeOwned + Debug, C: Corpus, E: Executor + HasObservers, I: Input,