tsffs/traits/mod.rs
1// Copyright (C) 2024 Intel Corporation
2// SPDX-License-Identifier: Apache-2.0
3
4use crate::tracer::{CmpExpr, CmpType};
5use anyhow::Result;
6
7/// Trait for disassemblers of various architectures to implement to permit branch
8/// and compare tracing
9pub trait TracerDisassembler {
10 fn disassemble(&mut self, bytes: &[u8]) -> Result<()>;
11 fn disassemble_to_string(&mut self, bytes: &[u8]) -> Result<String>;
12 fn last_was_control_flow(&self) -> bool;
13 fn last_was_call(&self) -> bool;
14 fn last_was_ret(&self) -> bool;
15 fn last_was_cmp(&self) -> bool;
16 fn cmp(&self) -> Vec<CmpExpr>;
17 fn cmp_type(&self) -> Vec<CmpType>;
18}