From af1ce3c723f00ba1b47f6a7ba607fab98baca242 Mon Sep 17 00:00:00 2001 From: Mark Date: Sun, 26 Jan 2025 13:21:34 -0800 Subject: [PATCH] Logging --- src/main.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 96cadd0..48bd2ea 100644 --- a/src/main.rs +++ b/src/main.rs @@ -82,9 +82,10 @@ impl Format { const OUT: usize = reduce::mono::out_size(IN_SIZE); let mut buf = [0u8; IN_SIZE]; loop { - src.read_exact(&mut buf)?; + src.read_exact(&mut buf) + .context("while reading framebuffer")?; reduce::mono::run(&mut buf); - tgt.write_all(&buf[0..OUT])?; + tgt.write_all(&buf[0..OUT]).context("while sending data")?; } } @@ -164,5 +165,7 @@ fn rm2_fb_offset(pid: usize) -> Result { .with_context(|| format!("Error parsing line in /proc/{}/maps", pid))?; let address = usize::from_str_radix(addr, 16).context("Error parsing framebuffer address")?; + println!("Found framebuffer at 0x{:X}", address); + Ok(address + 8) }