Skip to main content

ArchitectureOperations

Trait ArchitectureOperations 

Source
pub trait ArchitectureOperations {
    const INDEX_SELECTOR_REGISTER: &'static str;
    const ARGUMENT_REGISTER_0: &'static str;
    const ARGUMENT_REGISTER_1: &'static str;
    const ARGUMENT_REGISTER_2: &'static str;
    const POINTER_WIDTH_OVERRIDE: Option<i32> = None;
Show 17 methods // Required methods fn new(cpu: *mut ConfObject) -> Result<Self> where Self: Sized; fn cpu(&self) -> *mut ConfObject; fn disassembler(&mut self) -> &mut dyn TracerDisassembler; fn int_register(&mut self) -> &mut IntRegisterInterface; fn processor_info_v2(&mut self) -> &mut ProcessorInfoV2Interface; fn cpu_instruction_query(&mut self) -> &mut CpuInstructionQueryInterface; fn cpu_instrumentation_subscribe( &mut self, ) -> &mut CpuInstrumentationSubscribeInterface; fn cycle(&mut self) -> &mut CycleInterface; fn trace_pc( &mut self, instruction_query: *mut instruction_handle_t, ) -> Result<TraceEntry>; fn trace_cmp( &mut self, instruction_query: *mut instruction_handle_t, ) -> Result<TraceEntry>; // Provided methods fn new_unchecked(_: *mut ConfObject) -> Result<Self> where Self: Sized { ... } fn get_magic_index_selector(&mut self) -> Result<u64> { ... } fn get_magic_start_buffer_ptr_size_ptr(&mut self) -> Result<StartInfo> { ... } fn get_magic_start_buffer_ptr_size_val(&mut self) -> Result<StartInfo> { ... } fn get_magic_start_buffer_ptr_size_ptr_val(&mut self) -> Result<StartInfo> { ... } fn get_manual_start_info( &mut self, info: &ManualStartInfo, ) -> Result<StartInfo> { ... } fn write_start(&mut self, testcase: &[u8], info: &StartInfo) -> Result<()> { ... }
}
Expand description

Each architecture must provide a struct that performs architecture-specific operations

Required Associated Constants§

Provided Associated Constants§

Required Methods§

Source

fn new(cpu: *mut ConfObject) -> Result<Self>
where Self: Sized,

Create a new instance of the architecture operations

Source

fn cpu(&self) -> *mut ConfObject

Return the saved CPU object for this archtiecture

Source

fn disassembler(&mut self) -> &mut dyn TracerDisassembler

Return a mutable reference to the disassembler for this architecture

Source

fn int_register(&mut self) -> &mut IntRegisterInterface

Return a mutable reference to the interface for reading and writing registers

Source

fn processor_info_v2(&mut self) -> &mut ProcessorInfoV2Interface

Return a mutable reference to the interface for reading processor information

Source

fn cpu_instruction_query(&mut self) -> &mut CpuInstructionQueryInterface

Return a mutable reference to the interface for querying CPU instructions

Source

fn cpu_instrumentation_subscribe( &mut self, ) -> &mut CpuInstrumentationSubscribeInterface

Return a mutable reference to the interface for subscribing to CPU instrumentation events

Source

fn cycle(&mut self) -> &mut CycleInterface

Return a mutable reference to the interface for querying CPU cycles and timing

Source

fn trace_pc( &mut self, instruction_query: *mut instruction_handle_t, ) -> Result<TraceEntry>

Source

fn trace_cmp( &mut self, instruction_query: *mut instruction_handle_t, ) -> Result<TraceEntry>

Provided Methods§

Source

fn new_unchecked(_: *mut ConfObject) -> Result<Self>
where Self: Sized,

Create a new instance of the architecture operations without checking the CPU

Source

fn get_magic_index_selector(&mut self) -> Result<u64>

Return the value of the magic index selector register, which is used to determine whether a magic instruction should be used or skipped.

Source

fn get_magic_start_buffer_ptr_size_ptr(&mut self) -> Result<StartInfo>

Get the magic start information from the harness which takes the arguments:

  • buffer: The address of the buffer containing the testcase
  • size_ptr: A pointer to a pointer-sized variable containing the size of the testcase
Source

fn get_magic_start_buffer_ptr_size_val(&mut self) -> Result<StartInfo>

Get the magic start information from the harness which takes the arguments:

  • buffer: The address of the buffer containing the testcase
  • size_val: The maximum size of the testcase
Source

fn get_magic_start_buffer_ptr_size_ptr_val(&mut self) -> Result<StartInfo>

Get the magic start information from the harness which takes the arguments:

  • buffer: The address of the buffer containing the testcase
  • size_ptr: A pointer to a pointer-sized variable to which the size is written
  • size_val: The maximum size of the testcase
Source

fn get_manual_start_info(&mut self, info: &ManualStartInfo) -> Result<StartInfo>

Returns the address and whether the address is virtual for the testcase buffer used by the manual start functionality

Source

fn write_start(&mut self, testcase: &[u8], info: &StartInfo) -> Result<()>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl ArchitectureOperations for AArch64ArchitectureOperations

Source§

const INDEX_SELECTOR_REGISTER: &'static str = "x10"

Source§

const ARGUMENT_REGISTER_0: &'static str = "x9"

Source§

const ARGUMENT_REGISTER_1: &'static str = "x8"

Source§

const ARGUMENT_REGISTER_2: &'static str = "x7"

Source§

impl ArchitectureOperations for ARMArchitectureOperations

Source§

const INDEX_SELECTOR_REGISTER: &'static str = "r10"

Source§

const ARGUMENT_REGISTER_0: &'static str = "r9"

Source§

const ARGUMENT_REGISTER_1: &'static str = "r8"

Source§

const ARGUMENT_REGISTER_2: &'static str = "r7"

Source§

impl ArchitectureOperations for Architecture

Source§

const INDEX_SELECTOR_REGISTER: &'static str = ""

Source§

const ARGUMENT_REGISTER_0: &'static str = ""

Source§

const ARGUMENT_REGISTER_1: &'static str = ""

Source§

const ARGUMENT_REGISTER_2: &'static str = ""

Source§

impl ArchitectureOperations for RISCVArchitectureOperations

Source§

const INDEX_SELECTOR_REGISTER: &'static str = "x10"

Source§

const ARGUMENT_REGISTER_0: &'static str = "x11"

Source§

const ARGUMENT_REGISTER_1: &'static str = "x12"

Source§

const ARGUMENT_REGISTER_2: &'static str = "x13"

Source§

impl ArchitectureOperations for X86ArchitectureOperations

Source§

const INDEX_SELECTOR_REGISTER: &'static str = "edi"

Source§

const ARGUMENT_REGISTER_0: &'static str = "esi"

Source§

const ARGUMENT_REGISTER_1: &'static str = "edx"

Source§

const ARGUMENT_REGISTER_2: &'static str = "ecx"

Source§

const POINTER_WIDTH_OVERRIDE: Option<i32>

Source§

impl ArchitectureOperations for X86_64ArchitectureOperations

Source§

const INDEX_SELECTOR_REGISTER: &'static str = "rdi"

Source§

const ARGUMENT_REGISTER_0: &'static str = "rsi"

Source§

const ARGUMENT_REGISTER_1: &'static str = "rdx"

Source§

const ARGUMENT_REGISTER_2: &'static str = "rcx"