From 2c85df29a95c5fe1ed2b314c2e89df247ea6c6fc Mon Sep 17 00:00:00 2001 From: Chris Martin Date: Fri, 8 May 2026 10:26:23 -0400 Subject: [PATCH] Remove dead mem_reader.rs module --- src/linux/mem_reader.rs | 260 ---------------------------------------- 1 file changed, 260 deletions(-) delete mode 100644 src/linux/mem_reader.rs diff --git a/src/linux/mem_reader.rs b/src/linux/mem_reader.rs deleted file mode 100644 index e480e0fc..00000000 --- a/src/linux/mem_reader.rs +++ /dev/null @@ -1,260 +0,0 @@ -//! Functionality for reading a remote process's memory - -use { - super::{Pid, minidump_writer::MinidumpWriter, serializers::*}, - std::sync::OnceLock, -}; - -#[derive(Debug)] -enum Style { - /// Uses [`process_vm_readv`](https://linux.die.net/man/2/process_vm_readv) - /// to read the memory. - /// - /// This is not available on old <3.2 (really, ancient) kernels, and requires - /// the same permissions as ptrace - VirtualMem, - /// Reads the memory from `/proc//mem` - /// - /// Available on basically all versions of Linux, but could fail if the process - /// has insufficient privileges, ie ptrace - File(std::fs::File), - /// Reads the memory with [ptrace (`PTRACE_PEEKDATA`)](https://man7.org/linux/man-pages/man2/ptrace.2.html) - /// - /// Reads data one word at a time, so slow, but fairly reliable, as long as - /// the process can be ptraced - Ptrace, - /// No methods succeeded, generally there isn't a case where failing a syscall - /// will work if called again - Unavailable { - vmem: nix::Error, - file: nix::Error, - ptrace: nix::Error, - }, -} - -#[derive(Debug, thiserror::Error, serde::Serialize)] -#[error("Copy from process {child} failed (source {src}, offset: {offset}, length: {length})")] -pub struct CopyFromProcessError { - pub child: Pid, - pub src: usize, - pub offset: usize, - pub length: usize, - #[serde(serialize_with = "serialize_nix_error")] - pub source: nix::Error, -} - -pub struct MemReader { - /// The pid of the child to read - pid: nix::unistd::Pid, - style: OnceLock