Skip to content

Commit 652c24c

Browse files
authored
windows: Support LIBAFL_DEBUG_OUTPUT (#1569)
1 parent 7cb1080 commit 652c24c

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

libafl/src/events/launcher.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,8 @@ where
317317

318318
log::info!("spawning on cores: {:?}", self.cores);
319319

320+
let debug_output = std::env::var("LIBAFL_DEBUG_OUTPUT").is_ok();
321+
320322
//spawn clients
321323
for (id, _) in core_ids.iter().enumerate().take(num_cores) {
322324
if self.cores.ids.iter().any(|&x| x == id.into()) {
@@ -327,7 +329,13 @@ where
327329
};
328330

329331
std::env::set_var(_AFL_LAUNCHER_CLIENT, id.to_string());
330-
let child = startable_self()?.stdout(stdio).spawn()?;
332+
let mut child = startable_self()?;
333+
let child = (if debug_output {
334+
&mut child
335+
} else {
336+
child.stdout(stdio)
337+
})
338+
.spawn()?;
331339
handles.push(child);
332340
}
333341
}

0 commit comments

Comments
 (0)