windows: Support LIBAFL_DEBUG_OUTPUT (#1569)

This commit is contained in:
s1341 2023-09-28 11:16:41 +03:00 committed by GitHub
parent 7cb1080e35
commit 652c24cb2a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -317,6 +317,8 @@ where
log::info!("spawning on cores: {:?}", self.cores); log::info!("spawning on cores: {:?}", self.cores);
let debug_output = std::env::var("LIBAFL_DEBUG_OUTPUT").is_ok();
//spawn clients //spawn clients
for (id, _) in core_ids.iter().enumerate().take(num_cores) { for (id, _) in core_ids.iter().enumerate().take(num_cores) {
if self.cores.ids.iter().any(|&x| x == id.into()) { if self.cores.ids.iter().any(|&x| x == id.into()) {
@ -327,7 +329,13 @@ where
}; };
std::env::set_var(_AFL_LAUNCHER_CLIENT, id.to_string()); std::env::set_var(_AFL_LAUNCHER_CLIENT, id.to_string());
let child = startable_self()?.stdout(stdio).spawn()?; let mut child = startable_self()?;
let child = (if debug_output {
&mut child
} else {
child.stdout(stdio)
})
.spawn()?;
handles.push(child); handles.push(child);
} }
} }