diff --git a/.gitignore b/.gitignore index ea8c4bf..1a4595e 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /target +*.log diff --git a/Cargo.lock b/Cargo.lock index 5e91b13..a0f1727 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,9 +4,9 @@ version = 4 [[package]] name = "anstream" -version = "0.6.19" +version = "0.6.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "301af1932e46185686725e0fad2f8f2aa7da69dd70bf6ecc44d6b703844a3933" +checksum = "3ae563653d1938f79b1ab1b5e668c87c76a9930414574a6583a7b7e11a8e6192" dependencies = [ "anstyle", "anstyle-parse", @@ -34,22 +34,22 @@ dependencies = [ [[package]] name = "anstyle-query" -version = "1.1.3" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8bdeb6047d8983be085bab0ba1472e6dc604e7041dbf6fcd5e71523014fae9" +checksum = "9e231f6134f61b71076a3eab506c379d4f36122f2af15a9ff04415ea4c3339e2" dependencies = [ - "windows-sys 0.59.0", + "windows-sys 0.60.2", ] [[package]] name = "anstyle-wincon" -version = "3.0.9" +version = "3.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "403f75924867bb1033c59fbf0797484329750cfbe3c4325cd33127941fabc882" +checksum = "3e0633414522a32ffaac8ac6cc8f748e090c5717661fddeea04219e2344f5f2a" dependencies = [ "anstyle", "once_cell_polyfill", - "windows-sys 0.59.0", + "windows-sys 0.60.2", ] [[package]] @@ -115,9 +115,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.30" +version = "1.2.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "deec109607ca693028562ed836a5f1c4b8bd77755c4e132fc5ce11b0b6211ae7" +checksum = "c3a42d84bb6b69d3a8b3eaacf0d88f179e1929695e1ad012b6cf64d9caaa5fd2" dependencies = [ "shlex", ] @@ -182,7 +182,7 @@ dependencies = [ [[package]] name = "config" 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 = [ "libc", "ron", @@ -254,7 +254,7 @@ dependencies = [ [[package]] name = "fuzz_runner" 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 = [ "byteorder", "colored", @@ -352,7 +352,7 @@ checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776" [[package]] name = "libnyx" 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 = [ "cbindgen", "config", @@ -593,9 +593,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.141" +version = "1.0.142" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30b9eff21ebe718216c6ec64e1d9ac57087aad11efc64e32002bce4a0d4c03d3" +checksum = "030fedb782600dcbd6f02d479bf0d817ac3bb40d644745b769d6a96bc3afc5a7" dependencies = [ "itoa", "memchr", diff --git a/build.rs b/build.rs index f46c0cb..31e2c8a 100644 --- a/build.rs +++ b/build.rs @@ -53,7 +53,21 @@ fn setup_nyx(out_dir: &str) { "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}"), + ); } } diff --git a/src/main.rs b/src/main.rs index 2c1d04f..5e59af4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -12,6 +12,7 @@ fn main() -> Result<(), Box> { let mut nyx_config = NyxConfig::load(SHAREDIR_PATH)?; nyx_config.set_workdir_path(WORKDIR_PATH.to_string()); 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 fd = file.as_raw_fd();