Struct ckb_vm_debug_utils::GdbHandler
source · pub struct GdbHandler<M: Memory<REG = u64>> { /* private fields */ }Implementations§
source§impl<M: Memory<REG = u64>> GdbHandler<M>
impl<M: Memory<REG = u64>> GdbHandler<M>
pub fn new(machine: DefaultMachine<DefaultCoreMachine<u64, M>>) -> Self
Trait Implementations§
source§impl<M: Memory<REG = u64>> Handler for GdbHandler<M>
impl<M: Memory<REG = u64>> Handler for GdbHandler<M>
source§fn attached(&self, _pid: Option<u64>) -> Result<ProcessType, Error>
fn attached(&self, _pid: Option<u64>) -> Result<ProcessType, Error>
Indicate whether the process in question already existed, and
was attached to; or whether it was created by this server.
source§fn halt_reason(&self) -> Result<StopReason, Error>
fn halt_reason(&self) -> Result<StopReason, Error>
Return the reason that the inferior has halted.
source§fn read_general_registers(&self) -> Result<Vec<u8>, Error>
fn read_general_registers(&self) -> Result<Vec<u8>, Error>
Return the general registers. The registers are returned as a
vector of bytes, with the registers appearing contiguously in
a target-specific order, with the bytes laid out in the target
byte order.
source§fn read_register(&self, register: u64) -> Result<Vec<u8>, Error>
fn read_register(&self, register: u64) -> Result<Vec<u8>, Error>
Read the contents of the indicated register. The results
should be in target byte order. Note that a value-based API
is not provided here because on some architectures, there are
registers wider than ordinary integer types.
source§fn write_register(&self, register: u64, contents: &[u8]) -> Result<(), Error>
fn write_register(&self, register: u64, contents: &[u8]) -> Result<(), Error>
Set the contents of the indicated register to the given
contents. The contents are in target byte order. Note that a
value-based API is not provided here because on some
architectures, there are registers wider than ordinary integer
types.
source§fn read_memory(&self, region: MemoryRegion) -> Result<Vec<u8>, Error>
fn read_memory(&self, region: MemoryRegion) -> Result<Vec<u8>, Error>
Read a memory region.
source§fn write_memory(&self, address: u64, bytes: &[u8]) -> Result<(), Error>
fn write_memory(&self, address: u64, bytes: &[u8]) -> Result<(), Error>
Write the provided bytes to memory at the given address.
source§fn query_supported_vcont(&self) -> Result<Cow<'static, [VContFeature]>, Error>
fn query_supported_vcont(&self) -> Result<Cow<'static, [VContFeature]>, Error>
Query for a list of supported vCont features.
source§fn vcont(
&self,
request: Vec<(VCont, Option<ThreadId>)>
) -> Result<StopReason, Error>
fn vcont( &self, request: Vec<(VCont, Option<ThreadId>)> ) -> Result<StopReason, Error>
Resume with different actions for each thread. Choose the
first matching thread in the list.
source§fn insert_software_breakpoint(
&self,
breakpoint: Breakpoint
) -> Result<(), Error>
fn insert_software_breakpoint( &self, breakpoint: Breakpoint ) -> Result<(), Error>
Insert a software breakpoint.
source§fn remove_software_breakpoint(
&self,
breakpoint: Breakpoint
) -> Result<(), Error>
fn remove_software_breakpoint( &self, breakpoint: Breakpoint ) -> Result<(), Error>
Remove a software breakpoint.
source§fn insert_write_watchpoint(&self, watchpoint: Watchpoint) -> Result<(), Error>
fn insert_write_watchpoint(&self, watchpoint: Watchpoint) -> Result<(), Error>
Insert a write watchpoint.
source§fn remove_write_watchpoint(&self, wp: Watchpoint) -> Result<(), Error>
fn remove_write_watchpoint(&self, wp: Watchpoint) -> Result<(), Error>
Remove a write watchpoint.
source§fn query_supported_features(&self) -> Vec<String>
fn query_supported_features(&self) -> Vec<String>
Return a vector of additional features supported by this handler.
Note that there currently is no way to override the built-in
features that are always handled by the protocol
implementation.
source§fn kill(&self, _pid: Option<u64>) -> Result<(), Error>
fn kill(&self, _pid: Option<u64>) -> Result<(), Error>
Kill the indicated process. If no process is given, then the
precise effect is unspecified; but killing any or all
processes, or even rebooting an entire bare-metal target,
would be appropriate.
source§fn ping_thread(&self, _id: ThreadId) -> Result<(), Error>
fn ping_thread(&self, _id: ThreadId) -> Result<(), Error>
Check whether the indicated thread is alive. If alive, return
(). Otherwise, return an error.source§fn write_general_registers(&self, _contents: &[u8]) -> Result<(), Error>
fn write_general_registers(&self, _contents: &[u8]) -> Result<(), Error>
Write the general registers. The registers are specified as a
vector of bytes, with the registers appearing contiguously in
a target-specific order, with the bytes laid out in the target
byte order.
source§fn read_bytes(
&self,
_object: String,
_annex: String,
_offset: u64,
_length: u64
) -> Result<(Vec<u8>, bool), Error>
fn read_bytes( &self, _object: String, _annex: String, _offset: u64, _length: u64 ) -> Result<(Vec<u8>, bool), Error>
Read raw bytes from an object, such as “target.xml”. See
https://sourceware.org/gdb/onlinedocs/gdb/General-Query-Packets.html#qXfer-read,
which describes which kinds of qXfer packets are available. Read more
source§fn current_thread(&self) -> Result<Option<ThreadId>, Error>
fn current_thread(&self) -> Result<Option<ThreadId>, Error>
Return the identifier of the current thread.
source§fn set_current_thread(
&self,
_for: SetThreadFor,
_id: ThreadId
) -> Result<(), Error>
fn set_current_thread( &self, _for: SetThreadFor, _id: ThreadId ) -> Result<(), Error>
Set the current thread for future operations.
source§fn search_memory(
&self,
_address: u64,
_length: u64,
_bytes: &[u8]
) -> Result<Option<u64>, Error>
fn search_memory( &self, _address: u64, _length: u64, _bytes: &[u8] ) -> Result<Option<u64>, Error>
Search memory. The search begins at the given address, and
ends after length bytes have been searched. If the provided
bytes are not seen,
None should be returned; otherwise, the
address at which the bytes were found should be returned.source§fn invoke(&self, _: &[u8]) -> Result<String, Error>
fn invoke(&self, _: &[u8]) -> Result<String, Error>
Invoke a command. The command is just a sequence of bytes
(typically ASCII characters), to be interpreted by the server
in any way it likes. The result is output to send back to the
client. This is used to implement gdb’s
monitor command.source§fn set_address_randomization(&self, _enable: bool) -> Result<(), Error>
fn set_address_randomization(&self, _enable: bool) -> Result<(), Error>
Enable or disable address space randomization. This setting
should be used when launching a new process.
source§fn catch_syscalls(&self, _syscalls: Option<Vec<u64>>) -> Result<(), Error>
fn catch_syscalls(&self, _syscalls: Option<Vec<u64>>) -> Result<(), Error>
Start or stop catching syscalls. If the argument is
None, then
stop catching syscalls. Otherwise, start catching syscalls.
If any syscalls are specified, then only those need be caught;
however, it is ok to report syscall stops that aren’t in the
list if that is convenient.source§fn set_pass_signals(&self, _signals: Vec<u64>) -> Result<(), Error>
fn set_pass_signals(&self, _signals: Vec<u64>) -> Result<(), Error>
Set the list of “pass signals”. A signal marked as a pass
signal can be delivered to the inferior. No stopping or
notification of the client is required.
source§fn set_program_signals(&self, _signals: Vec<u64>) -> Result<(), Error>
fn set_program_signals(&self, _signals: Vec<u64>) -> Result<(), Error>
Set the list of “program signals”. A signal marked as a
program signal can be delivered to the inferior; other signals
should be silently discarded.
source§fn thread_info(&self, _thread: ThreadId) -> Result<String, Error>
fn thread_info(&self, _thread: ThreadId) -> Result<String, Error>
Return information about a given thread. The returned
information is just a string description that can be presented
to the user.
source§fn thread_list(&self, _reset: bool) -> Result<Vec<ThreadId>, Error>
fn thread_list(&self, _reset: bool) -> Result<Vec<ThreadId>, Error>
Return a list of all active thread IDs. GDB will call this in
a paging fashion: First query has
reset set to true and
should reply with the first chunk of threads. Further queries
have reset set to false and should respond with a chunk of
remaining threads, until completion which should return an
empty list to signify it’s the end. Read moresource§fn insert_hardware_breakpoint(
&self,
_breakpoint: Breakpoint
) -> Result<(), Error>
fn insert_hardware_breakpoint( &self, _breakpoint: Breakpoint ) -> Result<(), Error>
Insert a hardware breakpoint.
source§fn insert_read_watchpoint(&self, _watchpoint: Watchpoint) -> Result<(), Error>
fn insert_read_watchpoint(&self, _watchpoint: Watchpoint) -> Result<(), Error>
Insert a read watchpoint.
source§fn insert_access_watchpoint(&self, _watchpoint: Watchpoint) -> Result<(), Error>
fn insert_access_watchpoint(&self, _watchpoint: Watchpoint) -> Result<(), Error>
Insert an access watchpoint.
source§fn remove_hardware_breakpoint(
&self,
_breakpoint: Breakpoint
) -> Result<(), Error>
fn remove_hardware_breakpoint( &self, _breakpoint: Breakpoint ) -> Result<(), Error>
Remove a hardware breakpoint.
source§fn remove_read_watchpoint(&self, _watchpoint: Watchpoint) -> Result<(), Error>
fn remove_read_watchpoint(&self, _watchpoint: Watchpoint) -> Result<(), Error>
Remove a read watchpoint.
source§fn remove_access_watchpoint(&self, _watchpoint: Watchpoint) -> Result<(), Error>
fn remove_access_watchpoint(&self, _watchpoint: Watchpoint) -> Result<(), Error>
Remove an access watchpoint.
source§fn fs(&self) -> Result<&dyn FileSystem, ()>
fn fs(&self) -> Result<&dyn FileSystem, ()>
Return a filesystem handle to use for
vFile requests. Read moresource§fn process_symbol(
&self,
_sym_value: &str,
_sym_name: &str
) -> Result<SymbolLookupResponse, Error>
fn process_symbol( &self, _sym_value: &str, _sym_name: &str ) -> Result<SymbolLookupResponse, Error>
Notifies about symbol requests.
Auto Trait Implementations§
impl<M> !Freeze for GdbHandler<M>
impl<M> !RefUnwindSafe for GdbHandler<M>
impl<M> Send for GdbHandler<M>where
M: Send,
impl<M> !Sync for GdbHandler<M>
impl<M> Unpin for GdbHandler<M>where
M: Unpin,
impl<M> !UnwindSafe for GdbHandler<M>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more