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) }