From 47d15ade8143bac16614b570890c6909f41635ed Mon Sep 17 00:00:00 2001 From: cube0x8 Date: Wed, 22 May 2024 13:58:10 +0300 Subject: [PATCH] Instrumentation filters remove generic bound (#2053) * Removed S: UsesInput bound for HasInstrumentationFilter * cargo fmt * Removed S generic leftovers * cargo fmt * fix systemmode * unused imports * more verbose error. * clippy * debug test * still debugging * debug ci * sudo * debug * debug * debug * add g++ * build-essential * more deps... * restore to sane state. * remove useless comment. --------- Co-authored-by: Romain Malmain --- .github/workflows/build_and_test.yml | 13 ------ .../qemu-fuzzer-tester-prepare/action.yml | 43 +++++++++++++++++- libafl_qemu/libafl_qemu_build/src/build.rs | 5 ++- libafl_qemu/libafl_qemu_build/src/lib.rs | 6 ++- libafl_qemu/src/command/mod.rs | 34 +++++++------- libafl_qemu/src/command/parser.rs | 20 ++++----- libafl_qemu/src/emu/mod.rs | 2 +- libafl_qemu/src/helpers/asan.rs | 4 +- libafl_qemu/src/helpers/asan_guest.rs | 4 +- libafl_qemu/src/helpers/calls.rs | 4 +- libafl_qemu/src/helpers/cmplog.rs | 8 +--- libafl_qemu/src/helpers/drcov.rs | 6 +-- libafl_qemu/src/helpers/edges.rs | 20 +++------ libafl_qemu/src/helpers/mod.rs | 45 ++++++++----------- 14 files changed, 107 insertions(+), 107 deletions(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index a455a04e24..5033423348 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -308,12 +308,9 @@ jobs: - ./fuzzers/backtrace_baby_fuzzers - ./fuzzers/fuzzbench_qemu - ./fuzzers/nyx_libxml2_parallel - # - ./fuzzers/qemu_launcher - ./fuzzers/frida_gdiplus - ./fuzzers/libfuzzer_stb_image_concolic - ./fuzzers/nautilus_sync - # - ./fuzzers/qemu_cmin - # - ./fuzzers/qemu_systemmode - ./fuzzers/push_harness - ./fuzzers/libfuzzer_libpng_centralized - ./fuzzers/baby_fuzzer_nautilus @@ -337,7 +334,6 @@ jobs: - ./fuzzers/fuzzbench_forkserver # - ./fuzzers/libfuzzer_windows_asan - ./fuzzers/baby_fuzzer_minimizing - # - ./fuzzers/qemu_coverage - ./fuzzers/frida_executable_libpng - ./fuzzers/tutorial - ./fuzzers/baby_fuzzer_tokens @@ -351,10 +347,6 @@ jobs: steps: - uses: actions/checkout@v3 - uses: ./.github/workflows/fuzzer-tester-prepare - - name: Symlink Headers - if: runner.os == 'Linux' - shell: bash - run: sudo ln -s /usr/include/asm-generic /usr/include/asm - name: Build and run example fuzzers (Linux) if: runner.os == 'Linux' shell: bash @@ -393,11 +385,6 @@ jobs: steps: - uses: actions/checkout@v3 - uses: ./.github/workflows/qemu-fuzzer-tester-prepare - - uses: ./.github/workflows/fuzzer-tester-prepare - - name: Symlink Headers - if: runner.os == 'Linux' - shell: bash - run: sudo ln -s /usr/include/asm-generic /usr/include/asm - name: Build and run example QEMU fuzzers (Linux) if: runner.os == 'Linux' shell: bash diff --git a/.github/workflows/qemu-fuzzer-tester-prepare/action.yml b/.github/workflows/qemu-fuzzer-tester-prepare/action.yml index 337c68d1ac..5fa0e719c8 100644 --- a/.github/workflows/qemu-fuzzer-tester-prepare/action.yml +++ b/.github/workflows/qemu-fuzzer-tester-prepare/action.yml @@ -3,6 +3,45 @@ description: Sets up the QEMU fuzzers environment runs: using: composite steps: - - name: Install sudo + - uses: actions/checkout@v3 + with: + submodules: true + fetch-depth: 0 + - name: Install deps shell: bash - run: apt update && apt install -y sudo wget qemu-utils libsqlite3-dev gcc-arm-none-eabi \ No newline at end of file + run: apt update && apt install -y nasm ninja-build libc6-dev libgtk-3-dev pax-utils libz3-dev wget qemu-utils libsqlite3-dev gcc-arm-none-eabi sudo gcc g++ build-essential gcc-arm-linux-gnueabi g++-arm-linux-gnueabi + - uses: Swatinem/rust-cache@v2 + with: { shared-key: "${{ runner.os }}-shared-fuzzer-cache" } + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + - name: Add stable rustfmt and clippy + shell: bash + run: rustup toolchain install stable --component rustfmt --component clippy --allow-downgrade + - name: Add nightly rustfmt and clippy + shell: bash + run: rustup toolchain install nightly --component rustfmt --component clippy --allow-downgrade + - name: Remove obsolete llvm (Linux) + if: runner.os == 'Linux' + shell: bash + run: sudo apt purge -y llvm* clang* + - name: Install LLVM and Clang + uses: KyleMayes/install-llvm-action@v1 + with: + directory: ${{ runner.temp }}/llvm + version: 17 + - name: pip install + shell: bash + run: python3 -m pip install msgpack jinja2 find_libpython + - name: enable mult-thread for `make` + shell: bash + run: export MAKEFLAGS="-j$(expr $(nproc) \+ 1)" + - name: install cargo-make + uses: baptiste0928/cargo-install@v1.3.0 + with: + crate: cargo-make + - name: Symlink Headers + if: runner.os == 'Linux' + shell: bash + run: sudo ln -s /usr/include/asm-generic /usr/include/asm diff --git a/libafl_qemu/libafl_qemu_build/src/build.rs b/libafl_qemu/libafl_qemu_build/src/build.rs index 02f5cb7325..f482096a61 100644 --- a/libafl_qemu/libafl_qemu_build/src/build.rs +++ b/libafl_qemu/libafl_qemu_build/src/build.rs @@ -499,7 +499,10 @@ pub fn build( let link_str = format!("{link_command:?}"); - let output = link_command.output().expect("Partial linked failure"); + let output = match link_command.output() { + Ok(output) => output, + Err(e) => panic!("Command {link_command:?} failed: {e:?}"), + }; if !output.status.success() { fs::write(libafl_qemu_build_dir.join("link.command"), link_str) diff --git a/libafl_qemu/libafl_qemu_build/src/lib.rs b/libafl_qemu/libafl_qemu_build/src/lib.rs index 08479df936..a3b860a56c 100644 --- a/libafl_qemu/libafl_qemu_build/src/lib.rs +++ b/libafl_qemu/libafl_qemu_build/src/lib.rs @@ -1,18 +1,22 @@ #![forbid(unexpected_cfgs)] #![allow(clippy::missing_panics_doc)] +#[rustversion::nightly] +use std::io::{BufRead, BufReader}; use std::{ collections::hash_map, env, fs, fs::File, hash::Hasher, - io::{BufRead, BufReader, Read, Seek, SeekFrom, Write}, + io::{Read, Seek, SeekFrom, Write}, path::{Path, PathBuf}, process::Command, ptr::addr_of_mut, }; +#[rustversion::nightly] use regex::Regex; +#[rustversion::nightly] use rustc_version::Version; use which::which; diff --git a/libafl_qemu/src/command/mod.rs b/libafl_qemu/src/command/mod.rs index e11b621d0f..7a2dcb6fdf 100644 --- a/libafl_qemu/src/command/mod.rs +++ b/libafl_qemu/src/command/mod.rs @@ -54,7 +54,7 @@ macro_rules! define_std_command_manager { ($name:ident, [$($native_command_parser:ident),+]) => { pub struct $name where - QT: QemuHelperTuple + StdInstrumentationFilter + Debug, + QT: QemuHelperTuple + StdInstrumentationFilter + Debug, S: State + HasExecutions, S::Input: HasTargetBytes, SM: IsSnapshotManager, @@ -65,7 +65,7 @@ macro_rules! define_std_command_manager { impl $name where - QT: QemuHelperTuple + StdInstrumentationFilter + Debug, + QT: QemuHelperTuple + StdInstrumentationFilter + Debug, S: State + HasExecutions, S::Input: HasTargetBytes, SM: IsSnapshotManager, @@ -104,7 +104,7 @@ macro_rules! define_std_command_manager { impl CommandManager, QT, S> for $name where - QT: QemuHelperTuple + StdInstrumentationFilter + Debug, + QT: QemuHelperTuple + StdInstrumentationFilter + Debug, S: State + HasExecutions, S::Input: HasTargetBytes, SM: IsSnapshotManager, @@ -128,7 +128,7 @@ macro_rules! define_std_command_manager { impl Debug for $name where - QT: QemuHelperTuple + StdInstrumentationFilter + Debug, + QT: QemuHelperTuple + StdInstrumentationFilter + Debug, S: State + HasExecutions, S::Input: HasTargetBytes, SM: IsSnapshotManager, @@ -140,7 +140,7 @@ macro_rules! define_std_command_manager { impl Default for $name where - QT: QemuHelperTuple + StdInstrumentationFilter + Debug, + QT: QemuHelperTuple + StdInstrumentationFilter + Debug, S: State + HasExecutions, S::Input: HasTargetBytes, SM: IsSnapshotManager, @@ -233,7 +233,7 @@ pub struct SaveCommand; impl IsCommand, QT, S> for SaveCommand where CM: CommandManager, QT, S>, - QT: QemuHelperTuple + StdInstrumentationFilter + Debug, + QT: QemuHelperTuple + StdInstrumentationFilter + Debug, S: State + HasExecutions, S::Input: HasTargetBytes, SM: IsSnapshotManager, @@ -272,7 +272,7 @@ where allowed_paging_ids.insert(current_paging_id); let paging_filter = - HasInstrumentationFilter::::filter_mut( + HasInstrumentationFilter::::filter_mut( qemu_helpers, ); @@ -289,7 +289,7 @@ pub struct LoadCommand; impl IsCommand, QT, S> for LoadCommand where CM: CommandManager, QT, S>, - QT: QemuHelperTuple + StdInstrumentationFilter + Debug, + QT: QemuHelperTuple + StdInstrumentationFilter + Debug, S: State + HasExecutions, S::Input: HasTargetBytes, SM: IsSnapshotManager, @@ -330,7 +330,7 @@ pub struct InputCommand { impl IsCommand, QT, S> for InputCommand where CM: CommandManager, QT, S>, - QT: QemuHelperTuple + StdInstrumentationFilter + Debug, + QT: QemuHelperTuple + StdInstrumentationFilter + Debug, S: State + HasExecutions, S::Input: HasTargetBytes, SM: IsSnapshotManager, @@ -367,7 +367,7 @@ pub struct StartCommand { impl IsCommand, QT, S> for StartCommand where CM: CommandManager, QT, S>, - QT: QemuHelperTuple + StdInstrumentationFilter + Debug, + QT: QemuHelperTuple + StdInstrumentationFilter + Debug, S: State + HasExecutions, S::Input: HasTargetBytes, SM: IsSnapshotManager, @@ -418,7 +418,7 @@ pub struct EndCommand(Option); impl IsCommand, QT, S> for EndCommand where CM: CommandManager, QT, S>, - QT: QemuHelperTuple + StdInstrumentationFilter + Debug, + QT: QemuHelperTuple + StdInstrumentationFilter + Debug, S: State + HasExecutions, S::Input: HasTargetBytes, SM: IsSnapshotManager, @@ -455,7 +455,7 @@ pub struct VersionCommand(u64); impl IsCommand, QT, S> for VersionCommand where CM: CommandManager, QT, S>, - QT: QemuHelperTuple + StdInstrumentationFilter + Debug, + QT: QemuHelperTuple + StdInstrumentationFilter + Debug, S: State + HasExecutions, S::Input: HasTargetBytes, SM: IsSnapshotManager, @@ -496,7 +496,7 @@ where impl IsCommand, QT, S> for PagingFilterCommand where CM: CommandManager, QT, S>, - QT: QemuHelperTuple + StdInstrumentationFilter + Debug, + QT: QemuHelperTuple + StdInstrumentationFilter + Debug, S: State + HasExecutions, S::Input: HasTargetBytes, SM: IsSnapshotManager, @@ -516,9 +516,7 @@ where let qemu_helpers = qemu_executor_state.hooks_mut().helpers_mut(); let paging_filter = - HasInstrumentationFilter::::filter_mut( - qemu_helpers, - ); + HasInstrumentationFilter::::filter_mut(qemu_helpers); *paging_filter = self.filter.clone(); @@ -529,7 +527,7 @@ where impl IsCommand, QT, S> for AddressRangeFilterCommand where CM: CommandManager, QT, S>, - QT: QemuHelperTuple + StdInstrumentationFilter + Debug, + QT: QemuHelperTuple + StdInstrumentationFilter + Debug, S: State + HasExecutions, S::Input: HasTargetBytes, SM: IsSnapshotManager, @@ -550,7 +548,7 @@ where let qemu_helpers = qemu_executor_state.hooks_mut().helpers_mut(); let addr_range_filter = - HasInstrumentationFilter::::filter_mut( + HasInstrumentationFilter::::filter_mut( qemu_helpers, ); diff --git a/libafl_qemu/src/command/parser.rs b/libafl_qemu/src/command/parser.rs index 1c850efd94..d1b9cedfd6 100644 --- a/libafl_qemu/src/command/parser.rs +++ b/libafl_qemu/src/command/parser.rs @@ -41,7 +41,7 @@ impl NativeCommandParser, QT, S> for InputPhysCommandParser where CM: CommandManager, QT, S>, - QT: QemuHelperTuple + StdInstrumentationFilter + Debug, + QT: QemuHelperTuple + StdInstrumentationFilter + Debug, S: State + HasExecutions, S::Input: HasTargetBytes, SM: IsSnapshotManager, @@ -71,10 +71,10 @@ where pub struct InputVirtCommandParser; impl NativeCommandParser, QT, S> - for crate::command::parser::InputVirtCommandParser + for InputVirtCommandParser where CM: CommandManager, QT, S>, - QT: QemuHelperTuple + StdInstrumentationFilter + Debug, + QT: QemuHelperTuple + StdInstrumentationFilter + Debug, S: State + HasExecutions, S::Input: HasTargetBytes, SM: IsSnapshotManager, @@ -103,7 +103,7 @@ impl NativeCommandParser, QT, S> for StartPhysCommandParser where CM: CommandManager, QT, S>, - QT: QemuHelperTuple + StdInstrumentationFilter + Debug, + QT: QemuHelperTuple + StdInstrumentationFilter + Debug, S: State + HasExecutions, S::Input: HasTargetBytes, SM: IsSnapshotManager, @@ -133,7 +133,7 @@ impl NativeCommandParser, QT, S> for StartVirtCommandParser where CM: CommandManager, QT, S>, - QT: QemuHelperTuple + StdInstrumentationFilter + Debug, + QT: QemuHelperTuple + StdInstrumentationFilter + Debug, S: State + HasExecutions, S::Input: HasTargetBytes, SM: IsSnapshotManager, @@ -162,7 +162,7 @@ pub struct SaveCommandParser; impl NativeCommandParser, QT, S> for SaveCommandParser where CM: CommandManager, QT, S>, - QT: QemuHelperTuple + StdInstrumentationFilter + Debug, + QT: QemuHelperTuple + StdInstrumentationFilter + Debug, S: State + HasExecutions, S::Input: HasTargetBytes, SM: IsSnapshotManager, @@ -184,7 +184,7 @@ pub struct LoadCommandParser; impl NativeCommandParser, QT, S> for LoadCommandParser where CM: CommandManager, QT, S>, - QT: QemuHelperTuple + StdInstrumentationFilter + Debug, + QT: QemuHelperTuple + StdInstrumentationFilter + Debug, S: State + HasExecutions, S::Input: HasTargetBytes, SM: IsSnapshotManager, @@ -206,7 +206,7 @@ pub struct EndCommandParser; impl NativeCommandParser, QT, S> for EndCommandParser where CM: CommandManager, QT, S>, - QT: QemuHelperTuple + StdInstrumentationFilter + Debug, + QT: QemuHelperTuple + StdInstrumentationFilter + Debug, S: State + HasExecutions, S::Input: HasTargetBytes, SM: IsSnapshotManager, @@ -242,7 +242,7 @@ impl NativeCommandParser, QT, S> for VersionCommandParser where CM: CommandManager, QT, S>, - QT: QemuHelperTuple + StdInstrumentationFilter + Debug, + QT: QemuHelperTuple + StdInstrumentationFilter + Debug, S: State + HasExecutions, S::Input: HasTargetBytes, SM: IsSnapshotManager, @@ -267,7 +267,7 @@ impl NativeCommandParser, QT, S> for VaddrFilterAllowRangeCommandParser where CM: CommandManager, QT, S>, - QT: QemuHelperTuple + StdInstrumentationFilter + Debug, + QT: QemuHelperTuple + StdInstrumentationFilter + Debug, S: State + HasExecutions, S::Input: HasTargetBytes, SM: IsSnapshotManager, diff --git a/libafl_qemu/src/emu/mod.rs b/libafl_qemu/src/emu/mod.rs index 1a03a8ef7e..b10737aa0b 100644 --- a/libafl_qemu/src/emu/mod.rs +++ b/libafl_qemu/src/emu/mod.rs @@ -295,7 +295,7 @@ where // TODO: replace handlers with generics to permit compile-time customization of handlers impl EmulatorExitHandler for StdEmulatorExitHandler where - QT: QemuHelperTuple + StdInstrumentationFilter + Debug, + QT: QemuHelperTuple + StdInstrumentationFilter + Debug, S: State + HasExecutions, S::Input: HasTargetBytes, SM: IsSnapshotManager, diff --git a/libafl_qemu/src/helpers/asan.rs b/libafl_qemu/src/helpers/asan.rs index dab971bf21..df9575beb8 100644 --- a/libafl_qemu/src/helpers/asan.rs +++ b/libafl_qemu/src/helpers/asan.rs @@ -909,9 +909,7 @@ impl QemuAsanHelper { } } -impl HasInstrumentationFilter - for QemuAsanHelper -{ +impl HasInstrumentationFilter for QemuAsanHelper { fn filter(&self) -> &QemuInstrumentationAddressRangeFilter { &self.filter } diff --git a/libafl_qemu/src/helpers/asan_guest.rs b/libafl_qemu/src/helpers/asan_guest.rs index 5f7f800892..c5a70886ee 100644 --- a/libafl_qemu/src/helpers/asan_guest.rs +++ b/libafl_qemu/src/helpers/asan_guest.rs @@ -197,9 +197,7 @@ impl QemuAsanGuestHelper { } } -impl HasInstrumentationFilter - for QemuAsanGuestHelper -{ +impl HasInstrumentationFilter for QemuAsanGuestHelper { fn filter(&self) -> &QemuInstrumentationAddressRangeFilter { &self.filter } diff --git a/libafl_qemu/src/helpers/calls.rs b/libafl_qemu/src/helpers/calls.rs index 1bd6c19412..c777599297 100644 --- a/libafl_qemu/src/helpers/calls.rs +++ b/libafl_qemu/src/helpers/calls.rs @@ -384,11 +384,9 @@ where } } -impl HasInstrumentationFilter - for QemuCallTracerHelper +impl HasInstrumentationFilter for QemuCallTracerHelper where T: CallTraceCollectorTuple, - S: UsesInput, { fn filter(&self) -> &QemuInstrumentationAddressRangeFilter { &self.filter diff --git a/libafl_qemu/src/helpers/cmplog.rs b/libafl_qemu/src/helpers/cmplog.rs index 789b40de50..e637cfe6a1 100644 --- a/libafl_qemu/src/helpers/cmplog.rs +++ b/libafl_qemu/src/helpers/cmplog.rs @@ -66,9 +66,7 @@ impl Default for QemuCmpLogHelper { } } -impl HasInstrumentationFilter - for QemuCmpLogHelper -{ +impl HasInstrumentationFilter for QemuCmpLogHelper { fn filter(&self) -> &QemuInstrumentationAddressRangeFilter { &self.filter } @@ -347,9 +345,7 @@ impl QemuCmpLogRoutinesHelper { } #[cfg(emulation_mode = "usermode")] -impl HasInstrumentationFilter - for QemuCmpLogRoutinesHelper -{ +impl HasInstrumentationFilter for QemuCmpLogRoutinesHelper { fn filter(&self) -> &QemuInstrumentationAddressRangeFilter { &self.filter } diff --git a/libafl_qemu/src/helpers/drcov.rs b/libafl_qemu/src/helpers/drcov.rs index c59cd4eb60..46d26c77ec 100644 --- a/libafl_qemu/src/helpers/drcov.rs +++ b/libafl_qemu/src/helpers/drcov.rs @@ -76,11 +76,7 @@ impl QemuDrCovHelper { } } -impl HasInstrumentationFilter - for QemuDrCovHelper -where - S: UsesInput, -{ +impl HasInstrumentationFilter for QemuDrCovHelper { fn filter(&self) -> &QemuInstrumentationAddressRangeFilter { &self.filter } diff --git a/libafl_qemu/src/helpers/edges.rs b/libafl_qemu/src/helpers/edges.rs index a685bae258..e3547609fa 100644 --- a/libafl_qemu/src/helpers/edges.rs +++ b/libafl_qemu/src/helpers/edges.rs @@ -132,9 +132,7 @@ impl Default for QemuEdgeCoverageHelper { } } -impl HasInstrumentationFilter - for QemuEdgeCoverageHelper -{ +impl HasInstrumentationFilter for QemuEdgeCoverageHelper { fn filter(&self) -> &QemuInstrumentationAddressRangeFilter { &self.address_filter } @@ -145,9 +143,7 @@ impl HasInstrumentationFilter HasInstrumentationFilter - for QemuEdgeCoverageHelper -{ +impl HasInstrumentationFilter for QemuEdgeCoverageHelper { fn filter(&self) -> &QemuInstrumentationPagingFilter { &self.paging_filter } @@ -283,7 +279,7 @@ impl Default for QemuEdgeCoverageChildHelper { } } -impl HasInstrumentationFilter +impl HasInstrumentationFilter for QemuEdgeCoverageChildHelper { fn filter(&self) -> &QemuInstrumentationAddressRangeFilter { @@ -296,9 +292,7 @@ impl HasInstrumentationFilter HasInstrumentationFilter - for QemuEdgeCoverageChildHelper -{ +impl HasInstrumentationFilter for QemuEdgeCoverageChildHelper { fn filter(&self) -> &QemuInstrumentationPagingFilter { &self.paging_filter } @@ -432,7 +426,7 @@ impl Default for QemuEdgeCoverageClassicHelper { } } -impl HasInstrumentationFilter +impl HasInstrumentationFilter for QemuEdgeCoverageClassicHelper { fn filter(&self) -> &QemuInstrumentationAddressRangeFilter { @@ -445,9 +439,7 @@ impl HasInstrumentationFilter HasInstrumentationFilter - for QemuEdgeCoverageClassicHelper -{ +impl HasInstrumentationFilter for QemuEdgeCoverageClassicHelper { fn filter(&self) -> &QemuInstrumentationPagingFilter { &self.paging_filter } diff --git a/libafl_qemu/src/helpers/mod.rs b/libafl_qemu/src/helpers/mod.rs index c0b616ffc5..ac7c42d7be 100644 --- a/libafl_qemu/src/helpers/mod.rs +++ b/libafl_qemu/src/helpers/mod.rs @@ -137,10 +137,7 @@ where } } -impl HasInstrumentationFilter<(), S> for () -where - S: UsesInput, -{ +impl HasInstrumentationFilter<()> for () { fn filter(&self) -> &() { self } @@ -150,10 +147,9 @@ where } } -impl HasInstrumentationFilter for (Head, ()) +impl HasInstrumentationFilter for (Head, ()) where - Head: QemuHelper + HasInstrumentationFilter, - S: UsesInput, + Head: HasInstrumentationFilter, F: IsFilter, { fn filter(&self) -> &F { @@ -258,7 +254,7 @@ impl IsFilter for Vec> { } } -pub trait HasInstrumentationFilter +pub trait HasInstrumentationFilter where F: IsFilter, { @@ -273,15 +269,15 @@ where } #[cfg(emulation_mode = "usermode")] -pub trait StdInstrumentationFilter: - HasInstrumentationFilter +pub trait StdInstrumentationFilter: + HasInstrumentationFilter { } #[cfg(emulation_mode = "systemmode")] -pub trait StdInstrumentationFilter: - HasInstrumentationFilter - + HasInstrumentationFilter +pub trait StdInstrumentationFilter: + HasInstrumentationFilter + + HasInstrumentationFilter { } @@ -290,7 +286,7 @@ static mut EMPTY_ADDRESS_FILTER: UnsafeCell = UnsafeCell::new(QemuFilterList::None); -impl HasInstrumentationFilter for () { +impl HasInstrumentationFilter for () { fn filter(&self) -> &QemuInstrumentationAddressRangeFilter { &QemuFilterList::None } @@ -300,7 +296,7 @@ impl HasInstrumentationFilter for ( } } -impl HasInstrumentationFilter for () { +impl HasInstrumentationFilter for () { fn filter(&self) -> &QemuInstrumentationPagingFilter { &QemuFilterList::None } @@ -311,28 +307,23 @@ impl HasInstrumentationFilter for () { } #[cfg(emulation_mode = "systemmode")] -impl StdInstrumentationFilter for (Head, ()) -where - Head: QemuHelper - + HasInstrumentationFilter - + HasInstrumentationFilter, - S: UsesInput, +impl StdInstrumentationFilter for (Head, ()) where + Head: HasInstrumentationFilter + + HasInstrumentationFilter { } #[cfg(emulation_mode = "usermode")] -impl StdInstrumentationFilter for (Head, ()) -where - Head: QemuHelper + HasInstrumentationFilter, - S: UsesInput, +impl StdInstrumentationFilter for (Head, ()) where + Head: HasInstrumentationFilter { } #[cfg(emulation_mode = "systemmode")] -impl StdInstrumentationFilter for () where S: UsesInput {} +impl StdInstrumentationFilter for () {} #[cfg(emulation_mode = "usermode")] -impl StdInstrumentationFilter for () where S: UsesInput {} +impl StdInstrumentationFilter for () {} pub trait IsFilter: Debug { type FilterParameter;