Skip to content
Snippets Groups Projects
Commit 45d6e8ef authored by Per Lindgren's avatar Per Lindgren
Browse files

tidy

parent 2ca0b954
No related branches found
No related tags found
No related merge requests found
Pipeline #71 canceled
...@@ -255,7 +255,7 @@ fn main() { ...@@ -255,7 +255,7 @@ fn main() {
.output() .output()
.expect("failed to execute process"); .expect("failed to execute process");
let dump = c.output().expect("failed to execute process"); let dump = c.output().expect("failed to execute process");
//println!("{:?}", dump);
println!("\nstatus: {:?}", dump.status); println!("\nstatus: {:?}", dump.status);
println!("\nstdout: {:?}", str::from_utf8(&dump.stdout).unwrap()); println!("\nstdout: {:?}", str::from_utf8(&dump.stdout).unwrap());
println!("\nstderr: {:?}", str::from_utf8(&dump.stderr).unwrap()); println!("\nstderr: {:?}", str::from_utf8(&dump.stderr).unwrap());
...@@ -292,143 +292,4 @@ fn main() { ...@@ -292,143 +292,4 @@ fn main() {
} }
println!("{:?}", Dot::with_config(&g, &[Config::EdgeNoLabel])); println!("{:?}", Dot::with_config(&g, &[Config::EdgeNoLabel]));
// let hello = c.stdout();
// let mut p = c.spawn().unwrap();
// let mut pstderr = p.stderr.take().unwrap();
// let mut buf = [0; 1024];
// let mut output = vec![];
// let stderr = io::stderr();
// let mut stderr = stderr.lock();
// loop {
// if let Ok(n) = pstderr.read(&mut buf) {
// stderr.write(&buf[..n]).unwrap();
// output.extend_from_slice(&buf[..n]//
// }
// if let Some(status) = p.try_wait().unwrap() {
// assert!(status.success());
// break;
// }
// }
// -analyze -print-callgraph /home/pln/rust/stack-test/target/thumbv7m-none-eabi/release/deps/stack_test-87f399c0e9e1fb93.ll
// } else {
// panic!("could not determine hash, please recompile in `--release` mode");
// }
// find out the argument passed to `--example`, if used at all
// let mut example = None;
// let mut iargs = args.iter();
// while let Some(arg) = iargs.next() {
// if arg == "--example" {
// example = iargs.next();
// break;
// }
// }
// let output = str::from_utf8(&output).unwrap();
// if let (Some(hash), Some(crate_name), example) = parse_output(&output) {
// println!("{:?}, {:?}, {:?}", example, hash, crate_name);
// } else {
// panic!("could not determine hash, please recompile in `--release` mode");
// }
// // get the suffix of the example
// let (example, suffix) = if let Some(example) = example {
// let mut suffix = None;
// let output = str::from_utf8(&output).unwrap();
// println!("here ...");
// for line in output.lines() {
// if line.contains(&format!("examples/{}.rs", example)) {
// for part in line.split(' ') {
// if part.starts_with("extra-filename=") {
// suffix = part.split('=').nth(1);
// }
// }
// }
// }
// match suffix {
// None => panic!(format!(
// "Cannot determine hash, please run `touch example/{}.rs` to force recompiltaion.",
// example
// )),
// Some(s) => (example, s),
// }
// } else {
// // nothing to do if the user didn't use `--example`
// println!("try to determinte hash");
// let output = str::from_utf8(&output).unwrap();
// println!("here ...");
// let mut suffix = None;
// for line in output.lines() {
// for part in line.split(' ') {
// if part.starts_with("extra-filename=") {
// suffix = part.split('=').nth(1);
// }
// }
// }
// match suffix {
// None => panic!(format!(
// "Cannot determine hash, please force recompiltaion."
// )),
// Some(s) => panic!("main hash {}", s),
// }
// // return;
// };
// println!("{:?}", (example, suffix));
/*
let profile = if args.iter().any(|a| a == "--release") {
"release"
} else {
"debug"
};
let mut docker = Command::new("docker");
docker
.arg("run")
.arg("--rm")
.args(&["--user", &format!("{}:{}", uid(), gid())])
.args(&[
"-v",
&format!("{}:/mnt", env::current_dir().unwrap().display()),
])
.args(&["-w", "/mnt"])
.arg("-it")
.arg("afoht/llvm-klee-4")
.args(&[
"/usr/bin/klee",
&format!("target/{}/examples/{}{}.bc", profile, example, suffix),
]);
// print full command for debugging purposes
eprintln!("{:?}", docker);
assert!(docker.status().unwrap().success());
}
// NOTE from cross
fn gid() -> u32 {
unsafe { libc::getgid() }
}
// NOTE from cross
fn uid() -> u32 {
unsafe { libc::getuid() }
*/
} }
// blx511
// ARN
// LINDGREN
// PER
// 03021968 Piteå
// Swedish
// pass#
// Aquamarine
// Tourist
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment