Struct goblin::mach::load_command::ThreadCommand
source · [−]#[repr(C)]pub struct ThreadCommand {
pub cmd: u32,
pub cmdsize: u32,
pub flavor: u32,
pub count: u32,
pub thread_state: [u32; 70],
}
Expand description
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
Implementations
sourceimpl ThreadCommand
impl ThreadCommand
pub fn instruction_pointer(&self, cputype: CpuType) -> Result<u64>
Trait Implementations
sourceimpl Clone for ThreadCommand
impl Clone for ThreadCommand
sourceimpl Debug for ThreadCommand
impl Debug for ThreadCommand
sourceimpl<'a> TryFromCtx<'a, Endian, [u8]> for ThreadCommand
impl<'a> TryFromCtx<'a, Endian, [u8]> for ThreadCommand
impl Copy for ThreadCommand
Auto Trait Implementations
impl RefUnwindSafe for ThreadCommand
impl Send for ThreadCommand
impl Sync for ThreadCommand
impl Unpin for ThreadCommand
impl UnwindSafe for ThreadCommand
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more