in reverie-syscalls/src/args/mod.rs [374:403]
fn fmt<M: MemoryAccess>(
&self,
memory: &M,
outputs: bool,
f: &mut fmt::Formatter,
) -> fmt::Result {
match self {
None => f.write_str("NULL"),
Some(addr) => {
if outputs {
match addr.read(memory) {
Ok(stat) => {
// Print mode the same way strace does.
let sflag = SFlag::from_bits_truncate(stat.stx_mode.into());
let mode = Mode::from_bits_truncate(stat.stx_mode.into());
write!(
f,
"{} -> {{st_mode={:?} | 0{:o}, st_size={}, ...}}",
addr.0, sflag, mode, stat.stx_size
)
}
Err(e) => write!(f, "{} -> <{}>", addr.0, e),
}
} else {
// Just print the address when not displaying outputs.
fmt::Display::fmt(&addr.0, f)
}
}
}
}