SBLaunchInfo

Struct SBLaunchInfo 

Source
pub struct SBLaunchInfo {
    pub raw: SBLaunchInfoRef,
}
Expand description

Configuration for launching a process.

See SBTarget::launch().

Fields§

§raw: SBLaunchInfoRef

The underlying raw SBLaunchInfoRef.

Implementations§

Source§

impl SBLaunchInfo

Source

pub fn new() -> SBLaunchInfo

Construct a new SBLaunchInfo.

Examples found in repository?
examples/basic_synchronous.rs (line 13)
3fn main() {
4    SBDebugger::initialize();
5
6    let debugger = SBDebugger::create(false);
7    debugger.set_asynchronous(false);
8    println!("{debugger:?}");
9
10    if let Some(target) = debugger.create_target_simple("/usr/local/bin/servo") {
11        println!("{target:?}");
12
13        let launchinfo = SBLaunchInfo::new();
14        launchinfo.set_launch_flags(LaunchFlags::STOP_AT_ENTRY);
15        match target.launch(launchinfo) {
16            Ok(process) => {
17                println!("{process:?}");
18                let _ = process.continue_execution();
19                println!("{process:?}");
20            }
21            Err(e) => println!("Uhoh: {e:?}"),
22        }
23    }
24    SBDebugger::terminate();
25}
Source

pub fn process_id(&self) -> lldb_pid_t

Source

pub fn user_id(&self) -> Option<u32>

Source

pub fn set_user_id(&self, user_id: u32)

Source

pub fn group_id(&self) -> Option<u32>

Source

pub fn set_group_id(&self, group_id: u32)

Source

pub fn executable_file(&self) -> Option<SBFileSpec>

Source

pub fn set_executable_file(&self, filespec: &SBFileSpec, add_as_first_arg: bool)

Set the executable file that will be used to launch the process and optionally set it as the first argument in the argument vector.

This only needs to be specified if clients wish to carefully control the exact path will be used to launch a binary. If you create a target with a symlink, that symlink will get resolved in the target and the resolved path will get used to launch the process. Calling this function can help you still launch your process using the path of your choice.

If this function is not called prior to launching with SBTarget::launch(...), the target will use the resolved executable path that was used to create the target.

exe_file is the override path to use when launching the executable.

If add_as_first_arg is true, then the path will be inserted into the argument vector prior to launching. Otherwise the argument vector will be left alone.

Source

pub fn listener(&self) -> Option<SBListener>

Get the listener that will be used to receive process events.

If no listener has been set via a call to SBLaunchInfo::set_listener(), then None will be returned. If a listener has been set, then the listener object will be returned.

Source

pub fn set_listener(&self, listener: &SBListener)

Set the listener that will be used to receive process events.

By default the SBDebugger, which has a listener, that the SBTarget belongs to will listen for the process events. Calling this function allows a different listener to be used to listen for process events.

Source

pub fn launch_flags(&self) -> LaunchFlags

Source

pub fn set_launch_flags(&self, launch_flags: LaunchFlags)

Examples found in repository?
examples/basic_synchronous.rs (line 14)
3fn main() {
4    SBDebugger::initialize();
5
6    let debugger = SBDebugger::create(false);
7    debugger.set_asynchronous(false);
8    println!("{debugger:?}");
9
10    if let Some(target) = debugger.create_target_simple("/usr/local/bin/servo") {
11        println!("{target:?}");
12
13        let launchinfo = SBLaunchInfo::new();
14        launchinfo.set_launch_flags(LaunchFlags::STOP_AT_ENTRY);
15        match target.launch(launchinfo) {
16            Ok(process) => {
17                println!("{process:?}");
18                let _ = process.continue_execution();
19                println!("{process:?}");
20            }
21            Err(e) => println!("Uhoh: {e:?}"),
22        }
23    }
24    SBDebugger::terminate();
25}
Source

pub fn set_arguments<'a>( &self, args: impl IntoIterator<Item = &'a str>, append: bool, )

Specify the command line arguments.

Source

pub fn arguments(&self) -> impl Iterator<Item = &str>

Returns an iterator over the command line arguments.

Source

pub fn process_plugin_name(&self) -> Option<&str>

Source

pub fn set_process_plugin_name(&self, plugin: &str)

Source

pub fn shell(&self) -> Option<&str>

Source

pub fn set_shell(&self, shell: &str)

Source

pub fn shell_expand_arguments(&self) -> bool

Source

pub fn set_shell_expand_arguments(&self, expand: bool)

Source

pub fn resume_count(&self) -> u32

Source

pub fn set_resume_count(&self, resume_count: u32)

Source

pub fn add_close_file_action(&self, fd: i32) -> bool

Source

pub fn add_duplicate_file_action(&self, fd: i32, dup_fd: i32) -> bool

Source

pub fn add_open_file_action( &self, fd: i32, path: &str, read: bool, write: bool, ) -> bool

Source

pub fn add_suppress_file_action(&self, fd: i32, read: bool, write: bool) -> bool

Source

pub fn launch_event_data(&self) -> Option<&str>

Source

pub fn set_launch_event_data(&self, data: &str)

Source

pub fn detach_on_error(&self) -> bool

Source

pub fn set_detach_on_error(&self, detach: bool)

Trait Implementations§

Source§

impl Clone for SBLaunchInfo

Source§

fn clone(&self) -> SBLaunchInfo

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SBLaunchInfo

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for SBLaunchInfo

Source§

fn default() -> SBLaunchInfo

Returns the “default value” for a type. Read more
Source§

impl Drop for SBLaunchInfo

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl Send for SBLaunchInfo

Source§

impl Sync for SBLaunchInfo

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.