Skip to main content

MacsimRecord

Struct MacsimRecord 

Source
pub struct MacsimRecord {
Show 21 fields pub num_read_regs: u8, pub num_dest_regs: u8, pub src: [u8; 9], pub dst: [u8; 6], pub cf_type: u8, pub has_immediate: bool, pub opcode: u8, pub has_st: bool, pub is_fp: bool, pub write_flg: bool, pub num_ld: u8, pub size: u8, pub ld_vaddr1: u64, pub ld_vaddr2: u64, pub st_vaddr: u64, pub instruction_addr: u64, pub branch_target: u64, pub mem_read_size: u8, pub mem_write_size: u8, pub rep_dir: bool, pub actually_taken: bool,
}
Expand description

One MacSim x86 trace record (trace_info_cpu_s minus the last field).

Fields§

§num_read_regs: u8

Number of source registers.

§num_dest_regs: u8

Number of destination registers.

§src: [u8; 9]

Source register ids (Pin 3.13 REG).

§dst: [u8; 6]

Destination register ids.

§cf_type: u8

Control-flow type (CfType).

§has_immediate: bool

Has an immediate (never set by the Pin tool; kept 0).

§opcode: u8

Opcode: a CPU_OPCODE_ENUM value.

§has_st: bool

Has a store.

§is_fp: bool

Uses floating-point registers.

§write_flg: bool

Writes RFLAGS.

§num_ld: u8

Number of loads (0, 1 or 2).

§size: u8

Instruction size in bytes.

§ld_vaddr1: u64

First load address.

§ld_vaddr2: u64

Second load address.

§st_vaddr: u64

Store address.

§instruction_addr: u64

Instruction address (PC).

§branch_target: u64

Branch target.

§mem_read_size: u8

Load size in bytes.

§mem_write_size: u8

Store size in bytes.

§rep_dir: bool

Direction flag (for string instructions).

§actually_taken: bool

Branch taken.

Implementations§

Source§

impl MacsimRecord

Source

pub fn to_bytes(&self) -> [u8; 80]

Serializes to the 80-byte on-disk layout (x86-64 C ABI, with padding zeroed).

Source

pub fn from_bytes(b: &[u8; 80]) -> MacsimRecord

Parses the 80-byte on-disk layout.

Source

pub fn opcode_name(&self) -> &'static str

Name of the opcode, as MacSim prints it.

Trait Implementations§

Source§

impl Clone for MacsimRecord

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for MacsimRecord

Source§

impl Debug for MacsimRecord

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for MacsimRecord

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for MacsimRecord

Source§

impl PartialEq for MacsimRecord

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for MacsimRecord

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.