//! Provide exec-file path for the target. use crate::common::Pid; use crate::target::Target; use crate::target::TargetResult; /// Target Extension - Provide current exec-file. /// /// NOTE: this extension is primarily intended to be used alongside the [`Host /// I/O Extensions`](crate::target::ext::host_io), which enables the GDB client /// to read the executable file directly from the target pub trait ExecFile: Target { /// Get full absolute path of the file that was executed to create /// process `pid` running on the remote system. /// /// If `pid` is `None`, return the filename corresponding to the /// currently executing process. /// /// Return the number of bytes written into `buf` (which may be less than /// `length`). /// /// If `offset` is greater than the length of the underlying data, return /// `Ok(0)`. fn get_exec_file( &self, pid: Option, offset: u64, length: usize, buf: &mut [u8], ) -> TargetResult; } define_ext!(ExecFileOps, ExecFile);