Struct lldb::SBTarget [−][src]
pub struct SBTarget {
pub raw: SBTargetRef,
}
Expand description
The target program running under the debugger.
Process Management
Starting a debug session is done by launching the target, attaching to a running process, or loading a core file.
Launching
Launching a process can be done by creating and filling
out an SBLaunchInfo
and calling SBTarget::launch()
.
use lldb::*;
fn launch_target(target: &SBTarget) -> Result<SBProcess, SBError> {
let launch_info = SBLaunchInfo::new();
launch_info.set_launch_flags(LaunchFlags::STOP_AT_ENTRY);
// Probably want to set up a listener here.
target.launch(launch_info)
}
Attaching
Attaching to a process can be done by creating and filling
out an SBAttachInfo
and calling SBTarget::attach()
.
use lldb::{lldb_pid_t, SBAttachInfo, SBError, SBProcess, SBTarget};
fn attach_to_pid(target: &SBTarget, pid: lldb_pid_t) -> Result<SBProcess, SBError> {
let attach_info = SBAttachInfo::new_with_pid(pid);
// Probably want to set up a listener here.
target.attach(attach_info)
}
Core Files
…
Breakpoints and Watchpoints
…
Modules
…
Events
…
Fields
raw: SBTargetRef
The underlying raw SBTargetRef
.
Implementations
Construct a new Some(SBTarget)
or None
.
Get the SBPlatform
associated with this target.
After return, the platform object should be checked for validity.
Launch a target for debugging.
Get a filespec for the executable.
Add a module to the target.
Add a module to the target using an SBModuleSpec
.
Remove a module from the target.
Get the debugger controlling this target.
pub fn modules(&self) -> SBTargetModuleIter<'_>ⓘNotable traits for SBTargetModuleIter<'d>impl<'d> Iterator for SBTargetModuleIter<'d> type Item = SBModule;
pub fn modules(&self) -> SBTargetModuleIter<'_>ⓘNotable traits for SBTargetModuleIter<'d>impl<'d> Iterator for SBTargetModuleIter<'d> type Item = SBModule;
impl<'d> Iterator for SBTargetModuleIter<'d> type Item = SBModule;
Get an iterator over the modules known to this target instance.
Find the module for the given SBFileSpec
.
Resolve a current file address into a section offset address.
Resolve a current load address into a section offset address.
The return value will be None
if the vm_addr
doesn’t resolve to
a section within a module.
pub fn breakpoints(&self) -> SBTargetBreakpointIter<'_>ⓘNotable traits for SBTargetBreakpointIter<'d>impl<'d> Iterator for SBTargetBreakpointIter<'d> type Item = SBBreakpoint;
impl<'d> Iterator for SBTargetBreakpointIter<'d> type Item = SBBreakpoint;
pub fn watch_address(
&self,
addr: lldb_addr_t,
size: usize,
read: bool,
write: bool
) -> Result<SBWatchpoint, SBError>
pub fn watchpoints(&self) -> SBTargetWatchpointIter<'_>ⓘNotable traits for SBTargetWatchpointIter<'d>impl<'d> Iterator for SBTargetWatchpointIter<'d> type Item = SBWatchpoint;
impl<'d> Iterator for SBTargetWatchpointIter<'d> type Item = SBWatchpoint;
pub fn find_global_functions(
&self,
name: &str,
max_matches: u32,
matchtype: MatchType
) -> SBSymbolContextList
Evaluate an expression.
Trait Implementations
Performs the conversion.
Auto Trait Implementations
Blanket Implementations
Mutably borrows from an owned value. Read more