MCPcopy Create free account
hub / github.com/SeaQL/FireDBG.for.Rust / run_debugger

Function run_debugger

command/src/main.rs:783–860  ·  view source on GitHub ↗
(
    workspace: &Workspace,
    trace_cfg: &[(&Package, cfg::Trace)],
    sub_command: &str,
    executable: String,
    name: &str,
    package_name: &str,
    testcase: Option<&str>,
    args: Vec<

Source from the content-addressed store, hash-verified

781}
782
783async fn run_debugger(
784 workspace: &Workspace,
785 trace_cfg: &[(&Package, cfg::Trace)],
786 sub_command: &str,
787 executable: String,
788 name: &str,
789 package_name: &str,
790 testcase: Option<&str>,
791 args: Vec<String>,
792 output: Option<String>,
793 firedbg_home: Option<String>,
794) -> Result<()> {
795 let workspace_root_dir = &workspace.root_dir;
796 let workspace_output_dir = workspace.get_firedbg_target_dir();
797 let timestamp = SystemTime::now()
798 .duration_since(SystemTime::UNIX_EPOCH)?
799 .as_millis();
800 let output = output.unwrap_or(format!(
801 "{workspace_output_dir}/{name}-{timestamp}.firedbg.ss"
802 ));
803
804 let mut command = if env::var("CARGO_PKG_NAME").is_ok() {
805 let mut command = std::process::Command::new("cargo");
806 command
807 .current_dir(concat!(env!("CARGO_MANIFEST_DIR"), "/../debugger"))
808 .arg("run")
809 .arg("--");
810 command
811 } else {
812 let home = firedbg_home.unwrap_or(cargo_bin()?);
813 let home = home.trim_end_matches('/');
814 let mut command = std::process::Command::new(format!("{home}/firedbg-debugger"));
815 let lib_path = format!("{home}/firedbg-lib/lib");
816 if cfg!(target_os = "linux") {
817 command.env("LD_LIBRARY_PATH", lib_path);
818 } else if cfg!(target_os = "macos") {
819 command.env("DYLD_FALLBACK_LIBRARY_PATH", lib_path);
820 }
821 command
822 };
823 command.arg(sub_command).arg(executable);
824
825 if let Some(testcase) = testcase {
826 command.arg(testcase);
827 }
828
829 command
830 .arg("--workspace-root")
831 .arg(workspace_root_dir)
832 .arg("--output")
833 .arg(output)
834 .arg("--package-name")
835 .arg(package_name);
836
837 for (package, trace) in trace_cfg {
838 let package_path = if &package.root_dir != workspace_root_dir {
839 &package.root_dir[(workspace_root_dir.len() + 1)..]
840 } else {

Callers 4

run_binaryFunction · 0.85
run_testFunction · 0.85
run_unit_testFunction · 0.85
run_exampleFunction · 0.85

Calls 5

cargo_binFunction · 0.85
statusFunction · 0.85
to_strMethod · 0.80
lenMethod · 0.45

Tested by

no test coverage detected