basic_synchronous/
basic_synchronous.rs

1use lldb::{LaunchFlags, SBDebugger, SBLaunchInfo};
2
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}