Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
call-stack
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Per Lindgren
call-stack
Commits
45d6e8ef
Commit
45d6e8ef
authored
6 years ago
by
Per Lindgren
Browse files
Options
Downloads
Patches
Plain Diff
tidy
parent
2ca0b954
No related branches found
No related tags found
No related merge requests found
Pipeline
#71
canceled
6 years ago
Stage: build
Stage: test
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main.rs
+1
-140
1 addition, 140 deletions
src/main.rs
with
1 addition
and
140 deletions
src/main.rs
+
1
−
140
View file @
45d6e8ef
...
@@ -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!
(
"
\n
status: {:?}"
,
dump
.status
);
println!
(
"
\n
status: {:?}"
,
dump
.status
);
println!
(
"
\n
stdout: {:?}"
,
str
::
from_utf8
(
&
dump
.stdout
)
.unwrap
());
println!
(
"
\n
stdout: {:?}"
,
str
::
from_utf8
(
&
dump
.stdout
)
.unwrap
());
println!
(
"
\n
stderr: {:?}"
,
str
::
from_utf8
(
&
dump
.stderr
)
.unwrap
());
println!
(
"
\n
stderr: {:?}"
,
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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment