Skip to content

Commit

Permalink
Fixup rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
Jake-Shadle committed Aug 12, 2024
1 parent b487f89 commit 3de6aeb
Show file tree
Hide file tree
Showing 9 changed files with 138 additions and 138 deletions.
2 changes: 1 addition & 1 deletion src/bin/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ mod linux {
found_linux_gate = true;
dumper.suspend_threads()?;
let module_reader::BuildId(id) =
dumper.from_process_memory_for_mapping(&mapping)?;
PtraceDumper::from_process_memory_for_mapping(&mapping, ppid)?;
test!(!id.is_empty(), "id-vec is empty")?;
test!(id.iter().any(|&x| x > 0), "all id elements are 0")?;
dumper.resume_threads()?;
Expand Down
2 changes: 1 addition & 1 deletion src/linux/auxv/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
pub use reader::ProcfsAuxvIter;
use {
crate::linux::thread_info::Pid,
crate::Pid,
std::{fs::File, io::BufReader},
thiserror::Error,
};
Expand Down
4 changes: 3 additions & 1 deletion src/linux/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use thiserror::Error;
#[derive(Debug, Error)]
pub enum InitError {
#[error("failed to read auxv")]
ReadAuxvFailed(AuxvError),
ReadAuxvFailed(crate::auxv::AuxvError),
#[error("IO error for file {0}")]
IOError(String, #[source] std::io::Error),
#[error("crash thread does not reference principal mapping")]
Expand All @@ -18,6 +18,8 @@ pub enum InitError {
AndroidLateInitError(#[from] AndroidError),
#[error("Failed to read the page size")]
PageSizeError(#[from] Errno),
#[error("Ptrace does not function within the same process")]
CannotPtraceSameProcess,
}

#[derive(Error, Debug)]
Expand Down
2 changes: 1 addition & 1 deletion src/linux/maps_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ impl MappingInfo {
use super::module_reader::{ReadFromModule, SoName};

let mapped_file = MappingInfo::get_mmap(&self.name, self.offset)?;
Ok(SoName::read_from_module(&*mapped_file)
Ok(SoName::read_from_module((&*mapped_file).into())
.map_err(|e| MapsReaderError::NoSoName(self.name.clone().unwrap_or_default(), e))?
.0
.to_string())
Expand Down
2 changes: 1 addition & 1 deletion src/linux/mem_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ enum Style {
/// Reads the memory from `/proc/<pid>/mem`
///
/// Available on basically all versions of Linux, but could fail if the process
/// has insufficient priveleges, ie ptrace
/// 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)
///
Expand Down
Loading

0 comments on commit 3de6aeb

Please sign in to comment.