pub fn sys_thread_read_state(
        &self,
        handle: HandleValue,
        kind: u32,
        mut buffer: UserOutPtr<u8>,
        buffer_size: usize,
    ) -> ZxResult {
        let kind = ThreadStateKind::try_from(kind).map_err(|_| ZxError::INVALID_ARGS)?;
        info!(
            "thread.read_state: handle={:#x?}, kind={:#x?}, buf=({:#x?}; {:#x?})",
            handle, kind, buffer, buffer_size,
        );
        let proc = self.thread.proc();
        let thread = proc.get_object_with_rights::<Thread>(handle, Rights::READ)?;
        //TODO: Remove allocation
        let mut buf = vec![0; buffer_size];
        thread.read_state(kind, &mut buf)?;
        buffer.write_array(&buf[..])?;
        Ok(())
    }
/// Read one aspect of thread state.
///
/// The thread state may only be written when the thread is halted for an exception or the thread is suspended.
Read one aspect of thread state.
The thread state may only be written when the thread is halted for an exception or the thread is suspended.
Read one aspect of thread state . The thread state may only be written when the thread is halted for an exception or the thread is suspended .
pub fn sys_thread_read_state(
        &self,
        handle: HandleValue,
        kind: u32,
        mut buffer: UserOutPtr<u8>,
        buffer_size: usize,
    ) -> ZxResult {
        let kind = ThreadStateKind::try_from(kind).map_err(|_| ZxError::INVALID_ARGS)?;
        info!(
            "thread.read_state: handle={:#x?}, kind={:#x?}, buf=({:#x?}; {:#x?})",
            handle, kind, buffer, buffer_size,
        );
        let proc = self.thread.proc();
        let thread = proc.get_object_with_rights::<Thread>(handle, Rights::READ)?;
        //TODO: Remove allocation
        let mut buf = vec![0; buffer_size];
        thread.read_state(kind, &mut buf)?;
        buffer.write_array(&buf[..])?;
        Ok(())
    }
pub fn sys_thread_read_state ( & self , handle : HandleValue , kind : u32 , mut buffer : UserOutPtr < u8 > , buffer_size : usize , ) -> ZxResult { let kind = ThreadStateKind :: try_from ( kind ) . map_err ( | _ | ZxError :: INVALID_ARGS ) ? ; info ! ( " " handle kind buffer buffer_size ) ; let proc = self . thread . proc ( ) ; let thread = proc . get_object_with_rights :: < Thread > ( handle , Rights :: READ ) ? ; //TODO: Remove allocation let mut buf = vec ! [ 0 buffer_size ] ; thread . read_state ( kind , & mut buf ) ? ; buffer . write_array ( & buf [ .. ] ) ? ; Ok ( ( ) ) }
Read one aspect of thread state.
Read one aspect of thread state .
&self
handle
HandleValue
kind
u32
buffer
UserOutPtr<u8>
buffer_size
usize
&self
handle
HandleValue
kind
u32
buffer
UserOutPtr<u8>
buffer_size
usize