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

Check whether or not this is a valid SBTarget value.

Get the SBPlatform associated with this target.

After return, the platform object should be checked for validity.

Get the SBProcess associated with this target.

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.

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.

Evaluate an expression.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.