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

beta release (docs/debug out in bad shape)

parent 45d6e8ef
Branches master
No related tags found
No related merge requests found
Pipeline #72 canceled
...@@ -178,7 +178,7 @@ fn parse_callgraph(hm: &mut HashMap<String, NodeIndex<u32>>, g: &mut Graph<Node, ...@@ -178,7 +178,7 @@ fn parse_callgraph(hm: &mut HashMap<String, NodeIndex<u32>>, g: &mut Graph<Node,
} }
fn main() { 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 // first argument is the path to this binary; the second argument is always "call-stack" -- both can
// be ignored // be ignored
let args = env::args().skip(2).collect::<Vec<_>>(); let args = env::args().skip(2).collect::<Vec<_>>();
...@@ -231,7 +231,7 @@ fn main() { ...@@ -231,7 +231,7 @@ fn main() {
} }
let out = parse_out(str::from_utf8(&output).unwrap()); let out = parse_out(str::from_utf8(&output).unwrap());
println!("{:?}", out); eprintln!("{:?}", out);
use std::fmt::Write; use std::fmt::Write;
let mut s = String::new(); let mut s = String::new();
...@@ -246,7 +246,7 @@ fn main() { ...@@ -246,7 +246,7 @@ fn main() {
let mut ir = s.clone(); let mut ir = s.clone();
write!(&mut ir, ".ll").expect("internal error"); write!(&mut ir, ".ll").expect("internal error");
println!("s: {}", ir); eprintln!("s: {}", ir);
let mut c = Command::new("opt"); let mut c = Command::new("opt");
c.arg("-analyze") c.arg("-analyze")
...@@ -256,22 +256,22 @@ fn main() { ...@@ -256,22 +256,22 @@ fn main() {
.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!("\nstatus: {:?}", dump.status); eprintln!("\nstatus: {:?}", dump.status);
println!("\nstdout: {:?}", str::from_utf8(&dump.stdout).unwrap()); eprintln!("\nstdout: {:?}", str::from_utf8(&dump.stdout).unwrap());
println!("\nstderr: {:?}", str::from_utf8(&dump.stderr).unwrap()); eprintln!("\nstderr: {:?}", str::from_utf8(&dump.stderr).unwrap());
let mut g = Graph::<_, ()>::new(); let mut g = Graph::<_, ()>::new();
let mut hm = HashMap::new(); let mut hm = HashMap::new();
let mut buffer = Vec::new(); let mut buffer = Vec::new();
println!("elf = {}", &s); eprintln!("elf = {}", &s);
parse_elf(&mut hm, &mut g, &s, &mut buffer); parse_elf(&mut hm, &mut g, &s, &mut buffer);
parse_callgraph(&mut hm, &mut g, &str::from_utf8(&dump.stderr).unwrap()); parse_callgraph(&mut hm, &mut g, &str::from_utf8(&dump.stderr).unwrap());
if is_cyclic_directed(&g) { if is_cyclic_directed(&g) {
println!("/* warning, cyclic graph */"); eprintln!("Warning, cyclic graph ");
} }
let mut v = Vec::new(); let mut v = Vec::new();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment