[][src]Struct goblin::mach::load_command::ThreadCommand

#[repr(C)]
pub struct ThreadCommand {
    pub cmd: u32,
    pub cmdsize: u32,
    pub flavor: u32,
    pub count: u32,
    pub thread_state: [u32; 70],
}

Thread commands contain machine-specific data structures suitable for use in the thread state primitives. The machine specific data structures follow the struct thread_command as follows. Each flavor of machine specific data structure is preceded by an unsigned long constant for the flavor of that data structure, an uint32_t that is the count of longs of the size of the state data structure and then the state data structure follows. This triple may be repeated for many flavors. The constants for the flavors, counts and state data structure definitions are expected to be in the header file <machine/thread_status.h>. These machine specific data structures sizes must be multiples of 4 bytes The cmdsize reflects the total size of the thread_command and all of the sizes of the constants for the flavors, counts and state data structures.

For executable objects that are unix processes there will be one thread_command (cmd == LC_UNIXTHREAD) created for it by the link-editor. This is the same as a LC_THREAD, except that a stack is automatically created (based on the shell's limit for the stack size). CommandVariant arguments and environment variables are copied onto that stack.

Fields

cmd: u32

LC_THREAD or LC_UNIXTHREAD

cmdsize: u32

total size of this command

flavor: u32

flavor of thread state (but you also need to know the cputype)

count: u32

number of elements in thread_state that are valid

thread_state: [u32; 70]

The raw thread state, details of which varies by CPU

Methods

impl ThreadCommand[src]

pub fn instruction_pointer(&self, cputype: CpuType) -> Result<u64>[src]

Trait Implementations

impl Clone for ThreadCommand[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Copy for ThreadCommand[src]

impl Debug for ThreadCommand[src]

impl<'a> TryFromCtx<'a, Endian, [u8]> for ThreadCommand[src]

type Error = Error

type Size = usize

Auto Trait Implementations

Blanket Implementations

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]