diff --git a/src/main.rs b/src/main.rs index e60a45e586d9f36557325d7d4c0a8b04c9f2b940..cad1b8bf3102a8dedd5bc75c86efd3c2c0617e1b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -178,7 +178,7 @@ fn parse_callgraph(hm: &mut HashMap<String, NodeIndex<u32>>, g: &mut Graph<Node, } fn main() { - println!("start sub command"); + eprintln!("start sub command"); // first argument is the path to this binary; the second argument is always "call-stack" -- both can // be ignored let args = env::args().skip(2).collect::<Vec<_>>(); @@ -231,7 +231,7 @@ fn main() { } let out = parse_out(str::from_utf8(&output).unwrap()); - println!("{:?}", out); + eprintln!("{:?}", out); use std::fmt::Write; let mut s = String::new(); @@ -246,7 +246,7 @@ fn main() { let mut ir = s.clone(); write!(&mut ir, ".ll").expect("internal error"); - println!("s: {}", ir); + eprintln!("s: {}", ir); let mut c = Command::new("opt"); c.arg("-analyze") @@ -256,22 +256,22 @@ fn main() { .expect("failed to execute process"); let dump = c.output().expect("failed to execute process"); - println!("\nstatus: {:?}", dump.status); - println!("\nstdout: {:?}", str::from_utf8(&dump.stdout).unwrap()); - println!("\nstderr: {:?}", str::from_utf8(&dump.stderr).unwrap()); + eprintln!("\nstatus: {:?}", dump.status); + eprintln!("\nstdout: {:?}", str::from_utf8(&dump.stdout).unwrap()); + eprintln!("\nstderr: {:?}", str::from_utf8(&dump.stderr).unwrap()); let mut g = Graph::<_, ()>::new(); let mut hm = HashMap::new(); let mut buffer = Vec::new(); - println!("elf = {}", &s); + eprintln!("elf = {}", &s); parse_elf(&mut hm, &mut g, &s, &mut buffer); parse_callgraph(&mut hm, &mut g, &str::from_utf8(&dump.stderr).unwrap()); if is_cyclic_directed(&g) { - println!("/* warning, cyclic graph */"); + eprintln!("Warning, cyclic graph "); } let mut v = Vec::new();