Struct lldb::SBProcess
[−]
[src]
pub struct SBProcess {
pub raw: SBProcessRef,
}The process associated with the target program.
You get a process by attaching to or launching a target program.
See SBTarget for details.
Process State
The OS process ID (pid_t) for the process is available via
process_id.
The process state can be obtained via state. It is common to
just check to see if the process is_alive, is_running or
is_stopped.
Once the process is in the Exited state, the exit_status and
exit_description are available for inspection.
Execution Control
Once you have a process, you can:
Threads
The process contains the threads of execution for the target. The
available threads can be iterated over with threads:
// Iterate over the threads... for thread in process.threads() { println!("Hello {}!", thread.thread_id()); } // Or collect them into a vector! let threads = process.threads().collect::<Vec<SBThread>>();
Specific individual threads can be looked up via thread_by_id
and thread_by_index_id methods.
Some functions operate on the 'currently selected thread'. This can
retrieved via selected_thread and set via set_selected_thread,
set_selected_thread_by_id, or set_selected_thread_by_index_id.
Queues
A process may also have a set of queues associated with it. This is used
on macOS, iOS and other Apple operating systems to support debugger
integration with libdispatch, also known as GCD or "Grand Central
Dispatch".
The active queues can be iterated over with queues:
// Iterate over the queues... for queue in process.queues() { println!("Hello {}!", queue.queue_id()); }
Events
... to be written ...
Fields
raw: SBProcessRef
The underlying raw SBProcessRef.
Methods
impl SBProcess[src]
pub fn wrap(raw: SBProcessRef) -> SBProcess[src]
Construct a new SBProcess.
pub fn maybe_wrap(raw: SBProcessRef) -> Option<SBProcess>[src]
Construct a new Some(SBProcess) or None.
pub fn is_valid(&self) -> bool[src]
Check whether or not this is a valid SBProcess value.
pub fn broadcaster_class_name() -> &'static str[src]
pub fn state(&self) -> StateType[src]
The current state of this process (running, stopped, exited, etc.).
pub fn is_alive(&self) -> bool[src]
Returns true if the process is currently alive.
This corresponds to the process being in the Attaching,
Launching, Stopped, Running, Stepping, Crashed
or Suspended states.
pub fn is_running(&self) -> bool[src]
Returns true if the process is currently running.
This corresponds to the process being in the Running
or Stepping states.
pub fn is_stopped(&self) -> bool[src]
Returns true if the process is currently stopped.
This corresponds to the process being in the Stopped, Crashed,
or Suspended states.
pub fn exit_status(&self) -> i32[src]
The exit status of the process when the process state is
Exited.
pub fn exit_description(&self) -> &str[src]
The exit description of the process when the process state
is Exited.
pub fn process_id(&self) -> lldb_pid_t[src]
Returns the process ID of the process.
pub fn unique_id(&self) -> u32[src]
Returns an integer ID that is guaranteed to be unique across all process instances. This is not the process ID, just a unique integer for comparison and caching purposes.
pub fn address_byte_size(&self) -> u32[src]
Get the size, in bytes, of an address.
pub fn destroy(&self) -> Result<(), SBError>[src]
Kills the process and shuts down all threads that were spawned to track and monitor the process.
pub fn continue_execution(&self) -> Result<(), SBError>[src]
pub fn stop(&self) -> Result<(), SBError>[src]
pub fn kill(&self) -> Result<(), SBError>[src]
Same as calling destroy.
pub fn detach(&self) -> Result<(), SBError>[src]
pub fn signal(&self, signal: i32) -> Result<(), SBError>[src]
Send the process a Unix signal.
pub fn broadcaster(&self) -> SBBroadcaster[src]
ⓘImportant traits for SBProcessThreadIter<'d>pub fn threads(&self) -> SBProcessThreadIter[src]
Get an iterator over the threads known to this process instance.
ⓘImportant traits for SBProcessQueueIter<'d>pub fn queues(&self) -> SBProcessQueueIter[src]
Get an iterator over the queues known to this process instance.
pub fn thread_by_id(&self, thread_id: lldb_tid_t) -> Option<SBThread>[src]
Returns the thread with the given thread ID.
pub fn thread_by_index_id(&self, thread_index_id: u32) -> Option<SBThread>[src]
Returns the thread with the given thread index ID.
pub fn selected_thread(&self) -> SBThread[src]
Returns the currently selected thread.
pub fn set_selected_thread(&self, thread: &SBThread) -> bool[src]
Set the selected thread.
pub fn set_selected_thread_by_id(&self, thread_id: lldb_tid_t) -> bool[src]
Set the selected thread by ID.
pub fn set_selected_thread_by_index_id(&self, thread_index_id: u32) -> bool[src]
Set the selected thread by index ID.
pub fn event_as_process_event(event: &SBEvent) -> Option<SBProcessEvent>[src]
pub fn save_core(&self, file_name: &str) -> Result<(), SBError>[src]
Save the state of the process in a core file (or mini dump on Windows).
Trait Implementations
impl Debug for SBProcess[src]
fn fmt(&self, fmt: &mut Formatter) -> Result[src]
Formats the value using the given formatter. Read more