Struct TwizzlerTarget

Source
pub struct TwizzlerTarget {
    recv: Receiver<Event<MultiThreadStopReason<u64>>>,
    inner: Arc<TargetInner>,
    mon_t: Option<JoinHandle<()>>,
    chan_t: Option<JoinHandle<()>>,
    t_t: Option<JoinHandle<()>>,
    thread_repr_id: ObjID,
    libs: Vec<(String, ObjID, u64, Box<LinkMap>)>,
}

Fields§

§recv: Receiver<Event<MultiThreadStopReason<u64>>>§inner: Arc<TargetInner>§mon_t: Option<JoinHandle<()>>§chan_t: Option<JoinHandle<()>>§t_t: Option<JoinHandle<()>>§thread_repr_id: ObjID§libs: Vec<(String, ObjID, u64, Box<LinkMap>)>

Implementations§

Source§

impl TwizzlerTarget

Source

pub fn new(comp: CompartmentHandle, conn: Sender<u8>) -> Self

Source

fn mem_access( &mut self, addr: <<TwizzlerTarget as Target>::Arch as Arch>::Usize, len: usize, prot: Protections, ) -> TargetResult<usize, Self>

Source

fn mem_slice( &mut self, addr: <<TwizzlerTarget as Target>::Arch as Arch>::Usize, len: usize, ) -> TargetResult<&[u8], Self>

Source

fn mem_slice_mut( &mut self, addr: <<TwizzlerTarget as Target>::Arch as Arch>::Usize, len: usize, ) -> TargetResult<&mut [u8], Self>

Source

fn mem_slice_mut_writable( &mut self, addr: <<TwizzlerTarget as Target>::Arch as Arch>::Usize, len: usize, ) -> Result<RefSliceMut<'_, u8>, TwzError>

Source

fn get_thread_repr_id(&self, _tid: Tid) -> ObjID

Trait Implementations§

Source§

impl Breakpoints for TwizzlerTarget

Source§

fn support_sw_breakpoint(&mut self) -> Option<SwBreakpointOps<'_, Self>>

Support for setting / removing software breakpoints.
Source§

fn support_hw_breakpoint(&mut self) -> Option<HwBreakpointOps<'_, Self>>

Support for setting / removing hardware breakpoints.
Source§

fn support_hw_watchpoint(&mut self) -> Option<HwWatchpointOps<'_, Self>>

Support for setting / removing hardware watchpoints.
Source§

impl Drop for TwizzlerTarget

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl ExecFile for TwizzlerTarget

Source§

fn get_exec_file( &self, pid: Option<Pid>, offset: u64, length: usize, buf: &mut [u8], ) -> TargetResult<usize, Self>

Get full absolute path of the file that was executed to create process pid running on the remote system. Read more
Source§

impl HostIo for TwizzlerTarget

Source§

fn support_open(&mut self) -> Option<HostIoOpenOps<'_, Self>>

Support open operation.
Source§

fn support_close(&mut self) -> Option<HostIoCloseOps<'_, Self>>

Support close operation.
Source§

fn support_pread(&mut self) -> Option<HostIoPreadOps<'_, Self>>

Support pread operation.
Source§

fn support_fstat(&mut self) -> Option<HostIoFstatOps<'_, Self>>

Support fstat operation.
Support readlink operation.
§

fn support_pwrite( &mut self, ) -> Option<&mut dyn HostIoPwrite<Arch = Self::Arch, Error = Self::Error>>

Support pwrite operation.
Support unlink operation.
§

fn support_setfs( &mut self, ) -> Option<&mut dyn HostIoSetfs<Arch = Self::Arch, Error = Self::Error>>

Support setfs operation.
Source§

impl HostIoClose for TwizzlerTarget

Source§

fn close(&mut self, fd: u32) -> HostIoResult<(), Self>

Close the open file corresponding to fd.
Source§

impl HostIoFstat for TwizzlerTarget

Source§

fn fstat(&mut self, fd: u32) -> HostIoResult<HostIoStat, Self>

Get information about the open file corresponding to fd. Read more
Source§

impl HostIoOpen for TwizzlerTarget

Source§

fn open( &mut self, filename: &[u8], flags: HostIoOpenFlags, mode: HostIoOpenMode, ) -> HostIoResult<u32, Self>

Open a file at filename and return a file descriptor for it, or return [HostIoError::Errno] if an error occurs. Read more
Source§

impl HostIoPread for TwizzlerTarget

Source§

fn pread( &mut self, fd: u32, count: usize, offset: u64, buf: &mut [u8], ) -> HostIoResult<usize, Self>

Read data from the open file corresponding to fd. Read more
Read value of symbolic link filename on the target. Read more
Source§

impl LibrariesSvr4 for TwizzlerTarget

Source§

fn get_libraries_svr4( &self, offset: u64, length: usize, buf: &mut [u8], ) -> TargetResult<usize, Self>

Get library list XML for this target. Read more
Source§

impl MultiThreadBase for TwizzlerTarget

Source§

fn read_registers( &mut self, regs: &mut <Self::Arch as Arch>::Registers, tid: Tid, ) -> TargetResult<(), Self>

Read the target’s registers. Read more
Source§

fn write_registers( &mut self, regs: &<Self::Arch as Arch>::Registers, tid: Tid, ) -> TargetResult<(), Self>

Write the target’s registers. Read more
Source§

fn read_addrs( &mut self, start_addr: <Self::Arch as Arch>::Usize, data: &mut [u8], tid: Tid, ) -> TargetResult<usize, Self>

Read bytes from the specified address range and return the number of bytes that were read. Read more
Source§

fn write_addrs( &mut self, start_addr: <Self::Arch as Arch>::Usize, data: &[u8], tid: Tid, ) -> TargetResult<(), Self>

Write bytes to the specified address range. Read more
Source§

fn list_active_threads( &mut self, thread_is_active: &mut dyn FnMut(Tid), ) -> Result<(), Self::Error>

List all currently active threads. Read more
Source§

fn support_resume(&mut self) -> Option<MultiThreadResumeOps<'_, Self>>

Support for resuming the target (e.g: via continue or step)
§

fn support_single_register_access( &mut self, ) -> Option<&mut dyn SingleRegisterAccess<NonZero<usize>, Arch = Self::Arch, Error = Self::Error>>

Support for single-register access. See SingleRegisterAccess for more details. Read more
§

fn is_thread_alive(&mut self, tid: NonZero<usize>) -> Result<bool, Self::Error>

Check if the specified thread is alive. Read more
§

fn support_thread_extra_info( &mut self, ) -> Option<&mut dyn ThreadExtraInfo<Arch = Self::Arch, Error = Self::Error>>

Support for providing thread extra information.
Source§

impl MultiThreadResume for TwizzlerTarget

Source§

fn resume(&mut self) -> Result<(), Self::Error>

Resume execution on the target. Read more
Source§

fn clear_resume_actions(&mut self) -> Result<(), Self::Error>

Clear all previously set resume actions.
Source§

fn set_resume_action_continue( &mut self, tid: Tid, signal: Option<Signal>, ) -> Result<(), Self::Error>

Continue the specified thread. Read more
Source§

fn support_single_step(&mut self) -> Option<MultiThreadSingleStepOps<'_, Self>>

Support for optimized single stepping.
§

fn support_range_step( &mut self, ) -> Option<&mut dyn MultiThreadRangeStepping<Arch = Self::Arch, Error = Self::Error>>

Support for optimized range stepping.
§

fn support_reverse_step( &mut self, ) -> Option<&mut dyn ReverseStep<NonZero<usize>, Arch = Self::Arch, Error = Self::Error>>

Support for reverse stepping a target.
§

fn support_reverse_cont( &mut self, ) -> Option<&mut dyn ReverseCont<NonZero<usize>, Arch = Self::Arch, Error = Self::Error>>

Support for reverse continuing a target.
Source§

impl MultiThreadSingleStep for TwizzlerTarget

Source§

fn set_resume_action_step( &mut self, tid: Tid, signal: Option<Signal>, ) -> Result<(), Self::Error>

Single step the specified target thread. Read more
Source§

impl SwBreakpoint for TwizzlerTarget

Source§

fn add_sw_breakpoint( &mut self, addr: <Self::Arch as Arch>::Usize, _kind: <Self::Arch as Arch>::BreakpointKind, ) -> TargetResult<bool, Self>

Add a new software breakpoint. Read more
Source§

fn remove_sw_breakpoint( &mut self, addr: <Self::Arch as Arch>::Usize, kind: <Self::Arch as Arch>::BreakpointKind, ) -> TargetResult<bool, Self>

Remove an existing software breakpoint. Read more
Source§

impl Target for TwizzlerTarget

Source§

type Arch = X86_64_SSE

The target’s architecture.
Source§

type Error = TwzError

A target-specific fatal error.
Source§

fn base_ops(&mut self) -> BaseOps<'_, Self::Arch, Self::Error>

Base operations such as reading/writing from memory/registers, stopping/resuming the target, etc…. Read more
Source§

fn guard_rail_implicit_sw_breakpoints(&self) -> bool

If the target supports resumption, but hasn’t implemented explicit support for software breakpoints (via SwBreakpoints), notify the user that the GDB client may set “implicit” software breakpoints by rewriting the target’s instruction stream. Read more
Source§

fn support_exec_file(&mut self) -> Option<ExecFileOps<'_, Self>>

Support for reading the current exec-file.
Source§

fn support_host_io(&mut self) -> Option<HostIoOps<'_, Self>>

Support for Host I/O operations.
Source§

fn support_libraries_svr4(&mut self) -> Option<LibrariesSvr4Ops<'_, Self>>

Support for reading a list of libraries for SVR4 (System-V/Unix) platforms.
§

fn use_no_ack_mode(&self) -> bool

Enable/disable support for activating “no ack mode”. Read more
§

fn use_x_upcase_packet(&self) -> bool

Enable/disable using the more efficient X packet to write to target memory (as opposed to the basic M packet). Read more
§

fn use_resume_stub(&self) -> bool

Whether gdbstub should provide a “stub” resume implementation on targets without support for resumption. Read more
§

fn use_rle(&self) -> bool

Enable/Disable the use of run-length encoding on outgoing packets. Read more
§

fn use_target_description_xml(&self) -> bool

Whether to send a target description XML to the client. Read more
§

fn use_lldb_register_info(&self) -> bool

(LLDB extension) Whether to send register information to the client. Read more
§

fn support_breakpoints( &mut self, ) -> Option<&mut dyn Breakpoints<Arch = Self::Arch, Error = Self::Error>>

Support for setting / removing breakpoints.
§

fn support_monitor_cmd( &mut self, ) -> Option<&mut dyn MonitorCmd<Arch = Self::Arch, Error = Self::Error>>

Support for handling custom GDB monitor commands.
§

fn support_extended_mode( &mut self, ) -> Option<&mut dyn ExtendedMode<Arch = Self::Arch, Error = Self::Error>>

Support for Extended Mode operations.
§

fn support_section_offsets( &mut self, ) -> Option<&mut dyn SectionOffsets<Arch = Self::Arch, Error = Self::Error>>

Support for handling requests to get the target’s current section (or segment) offsets.
§

fn support_tracepoints( &mut self, ) -> Option<&mut dyn Tracepoints<Arch = Self::Arch, Error = Self::Error>>

Support for setting / removing tracepoints.
§

fn support_target_description_xml_override( &mut self, ) -> Option<&mut dyn TargetDescriptionXmlOverride<Arch = Self::Arch, Error = Self::Error>>

Support for overriding the target description XML specified by Target::Arch.
§

fn support_lldb_register_info_override( &mut self, ) -> Option<&mut dyn LldbRegisterInfoOverride<Arch = Self::Arch, Error = Self::Error>>

(LLDB extension) Support for overriding the register info specified by Target::Arch.
§

fn support_memory_map( &mut self, ) -> Option<&mut dyn MemoryMap<Arch = Self::Arch, Error = Self::Error>>

Support for reading the target’s memory map.
§

fn support_flash_operations( &mut self, ) -> Option<&mut dyn Flash<Arch = Self::Arch, Error = Self::Error>>

Support for flash memory operations.
§

fn support_catch_syscalls( &mut self, ) -> Option<&mut dyn CatchSyscalls<Arch = Self::Arch, Error = Self::Error>>

Support for setting / removing syscall catchpoints.
§

fn support_auxv( &mut self, ) -> Option<&mut dyn Auxv<Arch = Self::Arch, Error = Self::Error>>

Support for reading the target’s Auxillary Vector.

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<D> OwoColorize for D

§

fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>
where C: Color,

Set the foreground color generically Read more
§

fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>
where C: Color,

Set the background color generically. Read more
§

fn black(&self) -> FgColorDisplay<'_, Black, Self>

Change the foreground color to black
§

fn on_black(&self) -> BgColorDisplay<'_, Black, Self>

Change the background color to black
§

fn red(&self) -> FgColorDisplay<'_, Red, Self>

Change the foreground color to red
§

fn on_red(&self) -> BgColorDisplay<'_, Red, Self>

Change the background color to red
§

fn green(&self) -> FgColorDisplay<'_, Green, Self>

Change the foreground color to green
§

fn on_green(&self) -> BgColorDisplay<'_, Green, Self>

Change the background color to green
§

fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>

Change the foreground color to yellow
§

fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>

Change the background color to yellow
§

fn blue(&self) -> FgColorDisplay<'_, Blue, Self>

Change the foreground color to blue
§

fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>

Change the background color to blue
§

fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>

Change the foreground color to magenta
§

fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>

Change the background color to magenta
§

fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>

Change the foreground color to purple
§

fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>

Change the background color to purple
§

fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>

Change the foreground color to cyan
§

fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>

Change the background color to cyan
§

fn white(&self) -> FgColorDisplay<'_, White, Self>

Change the foreground color to white
§

fn on_white(&self) -> BgColorDisplay<'_, White, Self>

Change the background color to white
§

fn default_color(&self) -> FgColorDisplay<'_, Default, Self>

Change the foreground color to the terminal default
§

fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>

Change the background color to the terminal default
§

fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>

Change the foreground color to bright black
§

fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>

Change the background color to bright black
§

fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>

Change the foreground color to bright red
§

fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>

Change the background color to bright red
§

fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>

Change the foreground color to bright green
§

fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>

Change the background color to bright green
§

fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>

Change the foreground color to bright yellow
§

fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>

Change the background color to bright yellow
§

fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>

Change the foreground color to bright blue
§

fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>

Change the background color to bright blue
§

fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>

Change the foreground color to bright magenta
§

fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>

Change the background color to bright magenta
§

fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>

Change the foreground color to bright purple
§

fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>

Change the background color to bright purple
§

fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>

Change the foreground color to bright cyan
§

fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>

Change the background color to bright cyan
§

fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>

Change the foreground color to bright white
§

fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>

Change the background color to bright white
§

fn bold(&self) -> BoldDisplay<'_, Self>

Make the text bold
§

fn dimmed(&self) -> DimDisplay<'_, Self>

Make the text dim
§

fn italic(&self) -> ItalicDisplay<'_, Self>

Make the text italicized
§

fn underline(&self) -> UnderlineDisplay<'_, Self>

Make the text underlined
Make the text blink
Make the text blink (but fast!)
§

fn reversed(&self) -> ReversedDisplay<'_, Self>

Swap the foreground and background colors
§

fn hidden(&self) -> HiddenDisplay<'_, Self>

Hide the text
§

fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>

Cross out the text
§

fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>
where Color: DynColor,

Set the foreground color at runtime. Only use if you do not know which color will be used at compile-time. If the color is constant, use either [OwoColorize::fg] or a color-specific method, such as [OwoColorize::green], Read more
§

fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>
where Color: DynColor,

Set the background color at runtime. Only use if you do not know what color to use at compile-time. If the color is constant, use either [OwoColorize::bg] or a color-specific method, such as [OwoColorize::on_yellow], Read more
§

fn fg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>

Set the foreground color to a specific RGB value.
§

fn bg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>

Set the background color to a specific RGB value.
§

fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>

Sets the foreground color to an RGB value.
§

fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>

Sets the background color to an RGB value.
§

fn style(&self, style: Style) -> Styled<&Self>

Apply a runtime-determined style
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more