Skip to content

Commit

Permalink
feat: support finding binary with which
Browse files Browse the repository at this point in the history
  • Loading branch information
orhun authored and godzie44 committed Jun 12, 2024
1 parent afb62bc commit b1fa235
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 7 deletions.
31 changes: 25 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,12 @@ bit_field = "0.10.1"
serde = { version = "1.0.164", features = ["derive"] }
toml = "0.8.13"
home = "0.5.9"
which = "6.0.1"

[dev-dependencies]
serial_test = "3.0.0"

[features]
default = ["libunwind"]
libunwind = ["unwind"]
int_test = []
int_test = []
7 changes: 7 additions & 0 deletions src/ui/supervisor.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use std::path::Path;

use crate::debugger::process::Child;
use crate::debugger::DebuggerBuilder;
use crate::oracle::builtin;
Expand Down Expand Up @@ -62,6 +64,11 @@ impl Supervisor {

let process = match src {
DebugeeSource::File { path, args } => {
let path = if !Path::new(path).exists() {
which::which(path)?.to_string_lossy().to_string()
} else {
path.to_string()
};
let proc_tpl = Child::new(path, args, stdout_writer, stderr_writer);
proc_tpl
.install()
Expand Down

0 comments on commit b1fa235

Please sign in to comment.