Create qemu_nyx logfile in debug mode
This commit is contained in:
parent
5f42449b80
commit
5e526b9b9d
1
.gitignore
vendored
1
.gitignore
vendored
@ -1 +1,2 @@
|
|||||||
/target
|
/target
|
||||||
|
*.log
|
||||||
|
30
Cargo.lock
generated
30
Cargo.lock
generated
@ -4,9 +4,9 @@ version = 4
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "anstream"
|
name = "anstream"
|
||||||
version = "0.6.19"
|
version = "0.6.20"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "301af1932e46185686725e0fad2f8f2aa7da69dd70bf6ecc44d6b703844a3933"
|
checksum = "3ae563653d1938f79b1ab1b5e668c87c76a9930414574a6583a7b7e11a8e6192"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anstyle",
|
"anstyle",
|
||||||
"anstyle-parse",
|
"anstyle-parse",
|
||||||
@ -34,22 +34,22 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "anstyle-query"
|
name = "anstyle-query"
|
||||||
version = "1.1.3"
|
version = "1.1.4"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "6c8bdeb6047d8983be085bab0ba1472e6dc604e7041dbf6fcd5e71523014fae9"
|
checksum = "9e231f6134f61b71076a3eab506c379d4f36122f2af15a9ff04415ea4c3339e2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"windows-sys 0.59.0",
|
"windows-sys 0.60.2",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "anstyle-wincon"
|
name = "anstyle-wincon"
|
||||||
version = "3.0.9"
|
version = "3.0.10"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "403f75924867bb1033c59fbf0797484329750cfbe3c4325cd33127941fabc882"
|
checksum = "3e0633414522a32ffaac8ac6cc8f748e090c5717661fddeea04219e2344f5f2a"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anstyle",
|
"anstyle",
|
||||||
"once_cell_polyfill",
|
"once_cell_polyfill",
|
||||||
"windows-sys 0.59.0",
|
"windows-sys 0.60.2",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -115,9 +115,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cc"
|
name = "cc"
|
||||||
version = "1.2.30"
|
version = "1.2.31"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "deec109607ca693028562ed836a5f1c4b8bd77755c4e132fc5ce11b0b6211ae7"
|
checksum = "c3a42d84bb6b69d3a8b3eaacf0d88f179e1929695e1ad012b6cf64d9caaa5fd2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"shlex",
|
"shlex",
|
||||||
]
|
]
|
||||||
@ -182,7 +182,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "config"
|
name = "config"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://git.cs.tu-dortmund.de/david.venhoff/libnyx-fork#96f0e4512b874813d3df31c99b48391faeebb88a"
|
source = "git+https://git.cs.tu-dortmund.de/david.venhoff/libnyx-fork#d85fc2487a6427a0df699c7eaee37db70bc6858b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libc",
|
"libc",
|
||||||
"ron",
|
"ron",
|
||||||
@ -254,7 +254,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "fuzz_runner"
|
name = "fuzz_runner"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://git.cs.tu-dortmund.de/david.venhoff/libnyx-fork#96f0e4512b874813d3df31c99b48391faeebb88a"
|
source = "git+https://git.cs.tu-dortmund.de/david.venhoff/libnyx-fork#d85fc2487a6427a0df699c7eaee37db70bc6858b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"byteorder",
|
"byteorder",
|
||||||
"colored",
|
"colored",
|
||||||
@ -352,7 +352,7 @@ checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776"
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "libnyx"
|
name = "libnyx"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://git.cs.tu-dortmund.de/david.venhoff/libnyx-fork#96f0e4512b874813d3df31c99b48391faeebb88a"
|
source = "git+https://git.cs.tu-dortmund.de/david.venhoff/libnyx-fork#d85fc2487a6427a0df699c7eaee37db70bc6858b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cbindgen",
|
"cbindgen",
|
||||||
"config",
|
"config",
|
||||||
@ -593,9 +593,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde_json"
|
name = "serde_json"
|
||||||
version = "1.0.141"
|
version = "1.0.142"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "30b9eff21ebe718216c6ec64e1d9ac57087aad11efc64e32002bce4a0d4c03d3"
|
checksum = "030fedb782600dcbd6f02d479bf0d817ac3bb40d644745b769d6a96bc3afc5a7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"itoa",
|
"itoa",
|
||||||
"memchr",
|
"memchr",
|
||||||
|
16
build.rs
16
build.rs
@ -53,7 +53,21 @@ fn setup_nyx(out_dir: &str) {
|
|||||||
"git clone https://github.com/nyx-fuzz/QEMU-Nyx --depth 1",
|
"git clone https://github.com/nyx-fuzz/QEMU-Nyx --depth 1",
|
||||||
);
|
);
|
||||||
|
|
||||||
shell(qemu_path, "bash compile_qemu_nyx.sh full_static")
|
let is_debug_build = match env::var("DEBUG").unwrap().as_str() {
|
||||||
|
"true" => true,
|
||||||
|
"false" => false,
|
||||||
|
other => panic!("Invalid value for DEBUG: {other}"),
|
||||||
|
};
|
||||||
|
let qemu_compile_mode = if is_debug_build {
|
||||||
|
"debug_static"
|
||||||
|
} else {
|
||||||
|
// TODO: Consider using "lto"
|
||||||
|
"full_static"
|
||||||
|
};
|
||||||
|
shell(
|
||||||
|
qemu_path,
|
||||||
|
&format!("bash compile_qemu_nyx.sh {qemu_compile_mode}"),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,6 +12,7 @@ fn main() -> Result<(), Box<dyn Error>> {
|
|||||||
let mut nyx_config = NyxConfig::load(SHAREDIR_PATH)?;
|
let mut nyx_config = NyxConfig::load(SHAREDIR_PATH)?;
|
||||||
nyx_config.set_workdir_path(WORKDIR_PATH.to_string());
|
nyx_config.set_workdir_path(WORKDIR_PATH.to_string());
|
||||||
nyx_config.set_input_buffer_size(0x2000);
|
nyx_config.set_input_buffer_size(0x2000);
|
||||||
|
nyx_config.set_nyx_debug_log_path("qemu_nyx.log".to_string());
|
||||||
|
|
||||||
// let file = File::create("/tmp/nyx_test_output.log")?;
|
// let file = File::create("/tmp/nyx_test_output.log")?;
|
||||||
// let fd = file.as_raw_fd();
|
// let fd = file.as_raw_fd();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user